JANITORIAL: Remove trailing whitespaces

This commit is contained in:
Orgad Shaneh 2021-05-04 11:45:03 +03:00
parent 51f212d9dc
commit a05e54f00c
665 changed files with 5896 additions and 5899 deletions

View file

@ -14,7 +14,7 @@
SpaceAfterTemplateKeyword: false,
SpaceBeforeAssignmentOperators: true,
SpaceBeforeCtorInitializerColon: true,
SpaceBeforeInheritanceColon: true,
SpaceBeforeInheritanceColon: true,
SpaceInEmptyParentheses: false,
SpacesInAngles: false,
SpacesInParentheses: false,

View file

@ -4,7 +4,7 @@ Thank you for contributing to ScummVM. Please read the following carefully befor
Make sure your individual commits follow the guidelines found in the ScummVM Wiki: https://wiki.scummvm.org/index.php?title=Commit_Guidelines. If they're not please edit them before submitting the Pull Request.
Proper documentation must also be included for common code and changes impacting user facing elements.
Proper documentation must also be included for common code and changes impacting user facing elements.
Commits and Pull Requests should use the following template:

View file

@ -26,9 +26,9 @@ For the impatient among you, here is how to get ScummVM running in five simple s
5. Select the game you want to play in the list, and press Start. To play a game next time, skip to step 5, unless you want to add more games.
>
> Hint:
>
>
> Hint:
>
> To add multiple games in one go, press and hold the shift key, then click 'Add game' -- the label will change to 'Mass Add' and if you press it, you are again asked to select a directory, only this time ScummVM will search through all subdirectories for supported games.
@ -59,7 +59,7 @@ For everything you need to know about how to use ScummVM, see our [user document
### The ScummVM Wiki
[The wiki](https://wiki.scummvm.org/) is the place to go for information about every game supported by ScummVM. If you're a developer, there's also some very handy information in the Developer section.
[The wiki](https://wiki.scummvm.org/) is the place to go for information about every game supported by ScummVM. If you're a developer, there's also some very handy information in the Developer section.
### Changelog

View file

@ -66,7 +66,7 @@ public:
*
* @note You *must* check whether the returned value is less than what you requested.
* This indicates that the stream is fully used up.
*
*
*/
virtual int readBuffer(int16 *buffer, const int numSamples) = 0;
@ -81,7 +81,7 @@ public:
*
* If this returns true, it indicates that at this time there is no data
* available in the stream. However, there might be more data in the future.
*
*
* This is used by e.g. a rate converter to decide whether to keep on
* converting data or to stop.
*/
@ -92,7 +92,7 @@ public:
*
* If this returns true, it indicates that all data in this stream is used up
* and no additional data will appear in it in the future.
*
*
* This is used by the mixer to decide whether a given stream shall be
* removed from the list of active streams (and thus be destroyed).
* By default, this maps to endOfData().
@ -129,7 +129,7 @@ public:
* Create a looping audio stream object.
*
* On creation of the LoopingAudioStream object, the underlying stream will be rewound.
*
*
* @see makeLoopingAudioStream
*
* @param stream The stream to loop.

View file

@ -534,7 +534,7 @@ void MidiDriver_BASE::midiDumpFinish() {
midiDumpFile->write("\0\xff\x2f\0", 4); // meta event - end of track
midiDumpFile->write("MTrk", 4); // start of second track
midiDumpFile->writeUint32BE(_midiDumpCache.size() + 4); // track size (+4 because of the 'end of track' event)
midiDumpFile->write(_midiDumpCache.data(), _midiDumpCache.size());
midiDumpFile->write(_midiDumpCache.data(), _midiDumpCache.size());
midiDumpFile->write("\0\xff\x2f\0", 4); // meta event - end of track
midiDumpFile->finalize();
midiDumpFile->close();

View file

@ -164,7 +164,7 @@ public:
* method below.
*/
void send(byte status, byte firstOp, byte secondOp);
/**
* Send a MIDI command from a specific source. If the MIDI driver
* does not support multiple sources, the source parameter is
@ -191,7 +191,7 @@ public:
* This can be used to implement an alternate delay method than the
* OSystem::delayMillis function used by most sysEx implementations.
* Note that not every driver needs a delay, or supports this method.
* In this case, 0 is returned and the driver itself will do a delay
* In this case, 0 is returned and the driver itself will do a delay
* if necessary.
*
* For information on the SysEx data requirements, see the sysEx method.

View file

@ -110,8 +110,8 @@ public:
* @param volume Volume with which to play the sound, ranging from 0 to 255.
* @param balance Balance with which to play the sound, ranging from -127 to 127 (full left to full right).
* 0 is balanced, -128 is invalid.
* @param autofreeStream If set, the stream will be freed after the playback is finished.
* @param permanent If set, a plain stopAll call will not stop this particular stream.
* @param autofreeStream If set, the stream will be freed after the playback is finished.
* @param permanent If set, a plain stopAll call will not stop this particular stream.
* @param reverseStereo If set, left and right channels will be swapped.
*/
virtual void playStream(

View file

@ -51,12 +51,12 @@ const byte MidiDriver_MT32GM::MT32_DEFAULT_INSTRUMENTS[8] = {
// here; the driver is expected to flip these values based on the _midiDeviceReversePanning
// variable.
const byte MidiDriver_MT32GM::MT32_DEFAULT_PANNING[8] = {
// 7, 8, 7, 8, 4, A, 0, E
// 7, 8, 7, 8, 4, A, 0, E
0x40, 0x49, 0x40, 0x49, 0x25, 0x5B, 0x00, 0x7F
};
// This is the drum map for the Roland Sound Canvas SC-55 v1.xx. It had a fallback mechanism
// to correct invalid drumkit selections. Some games rely on this mechanism to select the
// This is the drum map for the Roland Sound Canvas SC-55 v1.xx. It had a fallback mechanism
// to correct invalid drumkit selections. Some games rely on this mechanism to select the
// correct Roland GS drumkit. Use this map to emulate this mechanism.
// E.g. correct invalid drumkit 50: GS_DRUMKIT_FALLBACK_MAP[50] == 48
const uint8 MidiDriver_MT32GM::GS_DRUMKIT_FALLBACK_MAP[128] = {
@ -697,7 +697,7 @@ byte MidiDriver_MT32GM::correctInstrumentBank(byte instrumentBank, byte patchId)
switch (patchId) {
case 25: // Steel-String Guitar / 12-string Guitar / Mandolin
// This instrument has 2 sub-capital tones. Bank selects 17-63
// This instrument has 2 sub-capital tones. Bank selects 17-63
// are corrected to the second sub-capital tone at 16.
if (instrumentBank >= 16) {
correctedBank = 16;

View file

@ -37,13 +37,13 @@
/**
* MIDI driver for MT-32 and GM compatible emulators and devices.
*
*
* This class contains some commonly needed functionality for these devices and
* the MIDI data that targets them. It wraps the MidiDriver instance that does
* the MIDI data that targets them. It wraps the MidiDriver instance that does
* the actual communication with the MT-32 or GM device.
*
*
* This driver has the following features:
*
*
* - MIDI device initialization
* Construct the driver with the type of MIDI data that will be sent to it.
* When the driver is opened, it will create an output MIDI driver appropriate
@ -51,7 +51,7 @@
* create the output MIDI driver yourself and pass it to the open function.
* The driver will take care of initializing the MIDI device and setting up
* for playback of MT-32 data on a GM/GS device or the other way around.
*
*
* - MT-32 <> GM conversion
* If the incoming MIDI data has been set to MT-32 and the output device is
* GM, the driver will map MT-32 instruments to GM equivalents. GM playback
@ -59,25 +59,25 @@
* _gmToMT32InstrumentMap variables to override the standard instrument maps,
* or override the mapMT32InstrumentToGM and mapGMInstrumentToMT32 functions
* for more advanced mapping algorithms.
*
*
* - User volume settings
* The driver will scale the MIDI channel volume using the user specified
* volume settings. Just call syncSoundSettings when the user has changed the
* volume settings. Set the USER_VOLUME_SCALING property to false to disable
* this functionality.
*
*
* - Reverse stereo
* If the game has MIDI data with reversed stereo compared to the targeted
* output device, set the MIDI_DATA_REVERSE_PANNING property to reverse
* stereo. The driver wil automatically reverse stereo when MT-32 data is
* sent to a GM/GS device or the other way around.
*
*
* - Correct Roland GS bank and drumkit selects
* Some games' MIDI data relies on a feature of the Roland SC-55 MIDI module
* which automatically corrects invalid bank selects and drumkit program
* changes. The driver replicates this feature to ensure correct instrument
* banks and drumkits on other hardware or softsynths.
*
*
* - SysEx queue
* The sysExQueue function will queue a SysEx message and return immediately.
* You can send more messages to the queue while the driver sends the
@ -88,7 +88,7 @@
* necessary amount of time for the MIDI device to process the message.
* Use clearSysExQueue to remove all messages from the queue, in case device
* initialization has to be aborted.
*
*
* - Multiple MIDI sources
* If the game plays multiple streams of MIDI data at the same time, each
* stream can be marked with a source number. This enables the following
@ -317,7 +317,7 @@ public:
/**
* Write data to an MT-32 memory location using a SysEx message.
* This function will add the necessary header and checksum bytes.
*
*
* @param msg Pointer to the data to write to a memory location
* @param length The data length
* @param targetAddress The start memory address in 8 bit format.
@ -362,7 +362,7 @@ public:
* volume will remain at the current value or be set to the start or end
* volume. If there is no active fade for the specified source, this
* function does nothing.
*
*
* @param source The source that should have its fade aborted
* @param abortType How to set the volume when aborting the fade (default:
* set to the target fade volume).
@ -395,7 +395,7 @@ public:
* Note that sources are not required to allocate channels, so if sources
* use conflicting MIDI channels, make sure to use this function
* consistently.
*
*
* @param source The source for which to allocate channels
* @param numChannels The number of channels to allocate
* @return True if allocation was successful, false otherwise (usually
@ -420,7 +420,7 @@ public:
*/
void setSourceVolume(uint16 volume);
/**
* Sets the volume for this source. The volume values in the MIDI data sent
* Sets the volume for this source. The volume values in the MIDI data sent
* by this source will be scaled by the source volume.
*/
virtual void setSourceVolume(uint8 source, uint16 volume);
@ -463,7 +463,7 @@ protected:
/**
* Initializes the MT-32 MIDI device. The device will be reset and,
* if the parameter is specified, set up for General MIDI data.
*
*
* @param initForGM True if the MT-32 should be initialized for GM mapping
*/
virtual void initMT32(bool initForGM);
@ -472,7 +472,7 @@ protected:
* If the initForMT32 parameter is specified, the device will be set up for
* MT-32 MIDI data. If the device supports Roland GS, the enableGS
* parameter can be specified for enhanced GS MT-32 compatiblity.
*
*
* @param initForMT32 True if the device should be initialized for MT-32 mapping
* @param enableGS True if the device should be initialized for GS MT-32 mapping
*/
@ -483,7 +483,7 @@ protected:
* This function is called after mapping the MIDI data channel to an output
* channel, so the specified output channel is used and not the channel in
* the event bytes.
*
*
* @param source The source of the event
* @param b The event MIDI bytes
* @param outputChannel The output channel for the event
@ -498,7 +498,7 @@ protected:
* Processes a note on or off MIDI event.
* This will apply source volume if necessary, update the active note
* registration and send the event to the MIDI device.
*
*
* @param outputChannel The MIDI output channel for the event
* @param command The MIDI command byte
* @param controlData The control data set that will be used for applying
@ -510,7 +510,7 @@ protected:
* Process a control change MIDI event.
* This will update the specified control data set and apply other
* processing if necessary, and then send the event to the MIDI device.
*
*
* @param outputChannel The MIDI output channel for the event
* @param controlData The control data set that the new controller value
* should be stored on
@ -524,9 +524,9 @@ protected:
* This will update the specified control data set, apply MT-32 <> GM
* instrument mapping and other processing, and send the event to the MIDI
* device.
*
*
* @param outputChannel The MIDI output channel for the event
* @param controlData The control data set that the new program value
* @param controlData The control data set that the new program value
* should be stored on
* @param channelLockedByOtherSource True if the output channel is locked
* by another source. Default is false.
@ -582,7 +582,7 @@ protected:
* Returns the MIDI output channel mapped to the specified data channel.
* If the data channel has not been mapped yet, a new mapping to one of the
* output channels available to the source will be created.
*
*
* @param source The source using the data channel
* @param dataChannel The data channel to map
* @return The mapped output channel, or -1 if no mapping is possible
@ -649,7 +649,7 @@ protected:
// The current number of microseconds that have to elapse before the next
// SysEx message can be sent.
uint32 _sysExDelay;
// Queue of SysEx messages to be sent to the MIDI device.
// Queue of SysEx messages to be sent to the MIDI device.
Common::Queue<SysExData> _sysExQueue;
// Mutex for write access to the SysEx queue.
Common::Mutex _sysExQueueMutex;

View file

@ -34,7 +34,7 @@ BaseStorage::BaseStorage() {}
BaseStorage::BaseStorage(Common::String token, Common::String refreshToken, bool enabled):
_token(token), _refreshToken(refreshToken) {
_isEnabled = enabled;
_isEnabled = enabled;
}
BaseStorage::~BaseStorage() {}
@ -189,7 +189,7 @@ void BaseStorage::tokenRefreshed(BoolCallback callback, Networking::JsonResponse
Common::JSONObject oauth;
bool requiresRefreshToken = !canReuseRefreshToken();
if (success) {
oauth = result.getVal("oauth")->asObject();
oauth = result.getVal("oauth")->asObject();
if (!Networking::CurlJsonRequest::jsonContainsString(oauth, "access_token", "BaseStorage::tokenRefreshed") ||
!Networking::CurlJsonRequest::jsonContainsString(oauth, "refresh_token", "BaseStorage::tokenRefreshed", !requiresRefreshToken)) {
warning("BaseStorage: bad response, no 'access_token' or 'refresh_token' attribute passed");

View file

@ -40,7 +40,7 @@ protected:
virtual void getAccessToken(Common::String code, Networking::ErrorCallback callback);
/**
* Handles JSON response which should contain access token requested
* Handles JSON response which should contain access token requested
* with getAccessToken().
*/
virtual void codeFlowComplete(Networking::ErrorCallback callback, Networking::JsonResponse response);

View file

@ -78,7 +78,7 @@ Common::DialogManager::DialogResult AmigaOSDialogManager::showFileBrowser(const
}
AslBase = nullptr;
IAsl = nullptr;
IExec->CloseLibrary(AslBase);
IExec->CloseLibrary(AslBase);
IExec->DropInterface((struct Interface*)IAsl);
}

View file

@ -23,7 +23,7 @@
#ifndef BACKEND_AMIGAOS_DIALOGS_H
#define BACKEND_AMIGAOS_DIALOGS_H
#if defined(__amigaos4__) && defined(USE_SYSDIALOGS)
#if defined(__amigaos4__) && defined(USE_SYSDIALOGS)
#include "common/dialogs.h"
#include "common/fs.h"

View file

@ -54,7 +54,7 @@ Common::DialogManager::DialogResult MorphosDialogManager::showFileBrowser(const
if (!fr)
return result;
if (AslRequestTags(fr, ASLFR_TitleText, (IPTR)newTitle.c_str(), ASLFR_RejectIcons, TRUE, ASLFR_InitialDrawer, (IPTR)pathBuffer, ASLFR_DrawersOnly, (isDirBrowser ? TRUE : FALSE), TAG_DONE)) {
if (strlen(fr->fr_Drawer) < sizeof(pathBuffer)) {
@ -63,7 +63,7 @@ Common::DialogManager::DialogResult MorphosDialogManager::showFileBrowser(const
if (!isDirBrowser) {
AddPart(pathBuffer, fr->fr_File, sizeof(pathBuffer));
}
choice = Common::FSNode(pathBuffer);
choice = Common::FSNode(pathBuffer);
result = kDialogOk;
}
FreeAslRequest((APTR)fr);

View file

@ -23,7 +23,7 @@
#ifndef BACKEND_MORPHOS_DIALOGS_H
#define BACKEND_MORPHOS_DIALOGS_H
#if defined(__MORPHOS__) && defined(USE_SYSDIALOGS)
#if defined(__MORPHOS__) && defined(USE_SYSDIALOGS)
#include "common/fs.h"
#include "common/dialogs.h"

View file

@ -70,7 +70,7 @@ typedef DWORD SICHINTF;
// Shell item
#define INTERFACE IShellItem
DECLARE_INTERFACE_(IShellItem, IUnknown) {
DECLARE_INTERFACE_(IShellItem, IUnknown) {
STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;

View file

@ -321,7 +321,7 @@ void PSP2EventSource::preprocessFingerMotion(SDL_Event *event) {
}
}
if (numFingersDownLong >= 2) {
// starting drag, so push mouse down at current location (back)
// starting drag, so push mouse down at current location (back)
// or location of "oldest" finger (front)
int mouseDownX = _mouseX;
int mouseDownY = _mouseY;

View file

@ -290,7 +290,7 @@ void SwitchEventSource::preprocessFingerMotion(SDL_Event *event) {
}
}
if (numFingersDownLong >= 2) {
// starting drag, so push mouse down at current location (back)
// starting drag, so push mouse down at current location (back)
// or location of "oldest" finger (front)
int mouseDownX = _mouseX;
int mouseDownY = _mouseY;

View file

@ -78,10 +78,10 @@ MorphOSFilesystemNode::MorphOSFilesystemNode(const Common::String &p) {
_bIsValid = false;
struct FileInfoBlock *fib = (struct FileInfoBlock*) AllocDosObject(DOS_FIB, NULL);
if (fib == NULL) {
debug(6,"Failed...");
return;
return;
}
BPTR pLock = Lock((CONST_STRPTR)_sPath.c_str(), SHARED_LOCK);
@ -133,10 +133,10 @@ MorphOSFilesystemNode::MorphOSFilesystemNode(BPTR pLock, const char *pDisplayNam
_bIsDirectory = false;
FileInfoBlock *fib = (FileInfoBlock*) AllocDosObject(DOS_FIB, NULL);
if (fib == NULL) {
debug(6,"Failed...");
return;
return;
}
if (Examine(pLock, fib) != DOSFALSE) {
@ -223,14 +223,14 @@ bool MorphOSFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b
}
FileInfoBlock *fib = (FileInfoBlock*) AllocDosObject(DOS_FIB, NULL);
if (fib == NULL) {
debug(6, "Failed to allocate memory for FileInfoBLock");
return false;
}
if (Examine(_pFileLock, fib) != DOSFALSE) {
MorphOSFilesystemNode *entry;
while (ExNext(_pFileLock, fib) != DOSFALSE) {
@ -246,7 +246,7 @@ bool MorphOSFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b
myList.push_back(entry);
}
UnLock(pLock);
}
}
}
}
if (ERROR_NO_MORE_ENTRIES != IoErr() ) {
@ -299,18 +299,18 @@ AbstractFSList MorphOSFilesystemNode::listVolumes() const {
char buffer[MAXPATHLEN];
dosList = LockDosList(kLockFlags);
if (dosList == NULL) {
debug(6, "Cannot lock the DOS list");
return myList;
}
dosList = NextDosEntry(dosList, LDF_VOLUMES);
MorphOSFilesystemNode *entry;
while (dosList) {
if (dosList->dol_Type == DLT_VOLUME &&
dosList->dol_Name &&
dosList->dol_Task) {

View file

@ -401,7 +401,7 @@ private:
width = fracToInt(height * displayAspect);
}
}
drawRect.left = ((_windowWidth - width) / 2) + _gameScreenShakeXOffset * width / getWidth();
drawRect.top = ((_windowHeight - height) / 2) + _gameScreenShakeYOffset * height / getHeight();
drawRect.setWidth(width);

View file

@ -34,7 +34,7 @@ struct HardwareInput;
/**
* Watches events for inputs that can be bound to actions
*
*
* When the watch mode is enabled, the watcher disables the Keymapper
* and sets itself as an event observer. Once an event corresponding
* to an hardware input is received, it is saved for later retrieval.

View file

@ -125,7 +125,7 @@ void SessionRequest::handle() {
if (_contentsStream.write(_buffer, readBytes) != readBytes)
warning("SessionRequest: unable to write all the bytes into MemoryWriteStreamDynamic");
if (_stream->eos()) {
if (_stream->eos()) {
finishSuccess();
}
}

View file

@ -59,7 +59,7 @@ public:
virtual void restart();
/** This request DOES NOT delete automatically after calling callbacks. It gets PAUSED, and in order to make it FINISHED (i.e. delete), this method MUST be called. */
void close();
void close();
bool complete();
bool success();

View file

@ -24,7 +24,7 @@ Table of Contents:
1.0) Installation
-----------------
There are two possible formats to be used: 3DSX and CIA.
The 3DSX format is considered more ethical because it does not make use of
The 3DSX format is considered more ethical because it does not make use of
invalid title IDs, which get logged. It is also compatible with homebrew loading
methods that do not involve CFW.
The 3DSX format is exclusively used by the Homebrew Launcher and its derivatives.
@ -35,7 +35,7 @@ Installing the Homebrew Launcher or any CFW is beyond the scope of this README.
1.1) 3DSX installation
----------------
You need to merely extract the ScummVM 3DSX files to your SD card so that all
You need to merely extract the ScummVM 3DSX files to your SD card so that all
files reside in the `/3ds/scummvm/` directory. It can then be launched by Homebrew Launcher
or a similar implementation.

View file

@ -39,7 +39,7 @@
; Force the w component of inpos to be 1.0
mov r0.xyz, inpos
mov r0.w, ones
; r1 = modelView * inpos
dp4 r1.x, modelView[0], r0
dp4 r1.y, modelView[1], r0

View file

@ -1,5 +1,5 @@
# Special target to create an AndroidSDL snapshot
androidsdl:
androidsdl:
$(MKDIR) release
$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(DIST_FILES_NETWORKING) $(DIST_FILES_VKEYBD) $(DIST_FILES_ENGINEDATA) release
$(INSTALL) -c -m 644 $(DIST_FILES_DOCS) release

View file

@ -2,7 +2,7 @@ MODULE := backends/platform/dingux
MODULE_OBJS := \
main.o \
dingux.o
dingux.o
# We don't use rules.mk but rather manually update OBJS and MODULE_DIRS.
MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS))

View file

@ -26,6 +26,6 @@ cd ../../../..
--enable-vkeybd
# --enable-plugins --default-dynamic
# --disable-release --enable-debug
# --disable-release --enable-debug
echo Generating config for GP2X complete. Check for errors.

View file

@ -78,7 +78,7 @@
dispatch_async(dispatch_get_global_queue(0, 0), ^{
iOS7_main(iOS7_argc, iOS7_argv);
});
if (_restoreState)
[_view restoreApplicationState];
else

View file

@ -685,7 +685,7 @@ uint getSizeNextPOT(uint size) {
GLfloat ratio = adjustedHeight / adjustedWidth;
int height = (int)(screenWidth * ratio);
//printf("Making rect (%u, %u)\n", screenWidth, height);
_gameScreenRect = CGRectMake(0, 0, screenWidth, height);
overlayPortraitRatio = (_videoContext.overlayHeight * ratio) / _videoContext.overlayWidth;

View file

@ -106,7 +106,7 @@ private:
OSystem_NULL::OSystem_NULL() {
#if defined(__amigaos4__)
_fsFactory = new AmigaOSFilesystemFactory();
#elif defined(__MORPHOS__)
#elif defined(__MORPHOS__)
_fsFactory = new MorphOSFilesystemFactory();
#elif defined(POSIX)
_fsFactory = new POSIXFilesystemFactory();

View file

@ -42,13 +42,13 @@ Analog - Moves in a direction (left/right/up/down) (Useful to k
Image Viewer
============
For your convenience, I've included a simple image viewer in the PSP port.
For your convenience, I've included a simple image viewer in the PSP port.
You can view anything you want while playing a game.
There are a few simple rules to follow:
- Images must be of PNG format. If you have images in another format, many
- Images must be of PNG format. If you have images in another format, many
graphics utilities will convert them for you.
- Images must be named psp_image1.png, psp_image2.png etc. This is to make
- Images must be named psp_image1.png, psp_image2.png etc. This is to make
sure there's no possible conflict between image files and game files.
- Images must be placed in the game directories. When using the image viewer,
only the images of the particular game being played will be available for viewing.

View file

@ -42,13 +42,13 @@ Analog - Moves in a direction (left/right/up/down) (Useful to k
Image Viewer
============
For your convenience, I've included a simple image viewer in the PSP port.
For your convenience, I've included a simple image viewer in the PSP port.
You can view anything you want while playing a game.
There are a few simple rules to follow:
- Images must be of PNG format. If you have images in another format, many
- Images must be of PNG format. If you have images in another format, many
graphics utilities will convert them for you.
- Images must be named psp_image1.png, psp_image2.png etc. This is to make
- Images must be named psp_image1.png, psp_image2.png etc. This is to make
sure there's no possible conflict between image files and game files.
- Images must be placed in the game directories. When using the image viewer,
only the images of the particular game being played will be available for viewing.

View file

@ -364,7 +364,7 @@ void DisplayManager::calculateScaleParams() {
_displayParams.screenOutput.width = (uint32)(PSP_SCREEN_HEIGHT * aspectRatio);
if (_displayParams.screenOutput.width > PSP_SCREEN_WIDTH) { // shrink if wider than screen
_displayParams.screenOutput.height = (uint32)(((float)PSP_SCREEN_HEIGHT * (float)PSP_SCREEN_WIDTH) / (float)_displayParams.screenOutput.width);
_displayParams.screenOutput.height = (uint32)(((float)PSP_SCREEN_HEIGHT * (float)PSP_SCREEN_WIDTH) / (float)_displayParams.screenOutput.width);
_displayParams.screenOutput.width = PSP_SCREEN_WIDTH;
}
}

View file

@ -108,7 +108,7 @@ void OSystem_PSP::engineDone() {
}
bool OSystem_PSP::hasFeature(Feature f) {
return (f == kFeatureOverlaySupportsAlpha || f == kFeatureCursorPalette ||
return (f == kFeatureOverlaySupportsAlpha || f == kFeatureCursorPalette ||
f == kFeatureKbdMouseSpeed || f == kFeatureJoystickDeadzone);
}

View file

@ -6,7 +6,7 @@
# Once a vanilla installation was created, none of the special subdirectories
# are found/accessible (extras, themes, plugins), instead ScummVM reports
# missing theme files and a missing valid translation.dat.
# Switching to AmigaOS' own "makedir" until there is a fix or other solution.
# Switching to AmigaOS' own "makedir" until there is a fix or other solution.
#
amigaosdist: $(EXECUTABLE) $(PLUGINS)
makedir all $(AMIGAOSPATH)

View file

@ -35,7 +35,7 @@ void OSystem_MorphOS::init() {
// Invoke parent implementation of this method
OSystem_SDL::init();
#if defined(USE_SYSDIALOGS)
_dialogManager = new MorphosDialogManager();
#endif
@ -44,12 +44,12 @@ void OSystem_MorphOS::init() {
bool OSystem_MorphOS::hasFeature(Feature f) {
if (f == kFeatureOpenUrl)
return true;
#if defined(USE_SYSDIALOGS)
if (f == kFeatureSystemBrowserDialog)
return true;
#endif
return OSystem_SDL::hasFeature(f);
}

View file

@ -21,5 +21,5 @@ ifdef DIST_FILES_THEMES
mkdir -p $(MORPHOSPATH)themes
cp $(DIST_FILES_THEMES) $(MORPHOSPATH)themes/
endif
# Strip
# Strip
$(STRIP) $(EXECUTABLE) -o $(MORPHOSPATH)$(EXECUTABLE)

View file

@ -81,7 +81,7 @@ int main(int argc, char *argv[]) {
game_id[path_param-gameid_param] = 0;
snprintf(path, 256, path_param + 6);
}
const char* args[4];
args[0] = "ux0:app/VSCU00001/eboot.bin";
args[1] = "-p";

View file

@ -64,7 +64,7 @@ static const Common::AxisTableEntry switchJoystickAxes[] = {
};
void OSystem_Switch::init() {
DrivesPOSIXFilesystemFactory *fsFactory = new DrivesPOSIXFilesystemFactory();
fsFactory->addDrive("sdmc:");
fsFactory->configureBuffering(DrivePOSIXFilesystemNode::kBufferingModeScummVM, 2048);

View file

@ -52,7 +52,7 @@ protected:
// Override createAudioCDManager() to get our Windows-specific
// version.
virtual AudioCDManager *createAudioCDManager() override;
HWND getHwnd() { return ((SdlWindow_Win32*)_window)->getHwnd(); }
};

View file

@ -128,7 +128,7 @@ my @excludes_snd = (
"TVP.cpp"
);
my @excludes_graphics = (
my @excludes_graphics = (
);
my @excludes_gui = (

View file

@ -10,7 +10,7 @@
Using parts of snprintf.c by
Mark Martinec <mark.martinec@ijs.si>, April 1999, June 2000
Copyright © 1999,2000,2001,2002 Mark Martinec. All rights reserved.
Copyright <EFBFBD> 1999,2000,2001,2002 Mark Martinec. All rights reserved.
under these conditions:
"Terms and conditions ...
This program is free software; it is dual licensed, the terms of the "Frontier Artistic License" or
@ -30,10 +30,10 @@ Release version: 2.2.0
For engines layout see ScummVM in OS help menu
Release version: 1.7.0
* Nothing significant in the Symbian port, except SDL improvements (new SDL version used)
Release version: 1.6.0
* Nothing significant in the Symbian port, except SDL improvements (new SDL version used)
Release version: 1.5.0
* Nothing significant in the Symbian port, except SDL improvements (new SDL version used)

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml:stylesheet href="\epoc32\tools\cshlpcmp\xsl\CSHproj.xsl" title="CS Help project" type="text/xsl"?>
<!DOCTYPE cshproj SYSTEM "\epoc32\tools\cshlpcmp\dtd\CSHproj.dtd">
<cshproj>
<helpfileUID>0x100039ce</helpfileUID> <!-- From help file -->
<directories>

View file

@ -3,7 +3,7 @@
# Part of : ScummVM
#
# Description: This is file for creating .hlp file
#
#
# ============================================================================

View file

@ -37,7 +37,7 @@
#pragma GCC diagnostic ignored "-Wnarrowing"
#endif
#include <e32def.h>
#if !defined(__IGNORE__E32STD_H__) // TKey type from system header
#if !defined(__IGNORE__E32STD_H__) // TKey type from system header
#include <e32std.h> // doesn't meets with lua ones.
#endif
#if (__GNUC__ && __cplusplus)
@ -178,7 +178,7 @@ namespace std
((sizeof (x) == sizeof (float)) ? __signbitf(x) \
: (sizeof (x) == sizeof (double)) ? __signbit(x) \
: __signbitl(x))
#endif
#endif
// Functions from openlibm not declared in Symbian math.h
extern "C"{

View file

@ -47,7 +47,7 @@ active_config = ("DISABLE_NUKED_OPL", "USE_A52", "USE_MPEG2", "USE_BINK", "USE_
"ENABLE_VKEYBD")
#activate USE_SCALERS USE_ARM_SCALER_ASM USE_TTS USE_SPEECH_DISPATCHER USE_CLOUD USE_LIBCURL
# USE_SDL_NET USE_DISCORD USE_UPDATES USE_LUA
disabled_config = ("USE_ALSA", "ENABLE_OPL2LPT", "USE_SCALERS", "USE_ARM_SCALER_ASM",
disabled_config = ("USE_ALSA", "ENABLE_OPL2LPT", "USE_SCALERS", "USE_ARM_SCALER_ASM",
"USE_HQ_SCALERS", "USE_NASM", "USE_ELF_LOADER", "USE_SDL2", "USE_FLUIDSYNTH", "USE_TTS", "USE_SPEECH_DISPATCHER",
"USE_CLOUD", "USE_LIBCURL", "USE_SDL_NET", "USE_OPENGL", "USE_DISCORD", "USE_LINUXCD", "ENABLE_EVENTRECORDER",
"USE_UPDATES", "USE_LUA")

View file

@ -321,7 +321,7 @@ def check_cashed():
macros = os.path.join(local, "macros.mmh")
engines = os.path.join(local, "engines.mmh")
engines_new = os.path.join(local, "engines.mmh.new")
macros_dump = data_dump(macros)
macros_dump_new = data_dump(macros_new)
macros_diff = set(macros_dump).symmetric_difference(set(macros_dump_new))
@ -330,12 +330,12 @@ def check_cashed():
SafeWriteFile(build_log, 'a', "new macro found: ")
SafeWriteFile(build_log, 'a', list(macros_diff))
SafeWriteFile(macros, 'a', list(macros_diff))
engines_dump = data_dump(engines)
engines_dump_new = data_dump(engines_new)
engines_diff = set(engines_dump).symmetric_difference(set(engines_dump_new))
SafeWriteFile(engines, 'a', list(engines_diff))
os.chmod(macros, stat.S_IREAD)
os.chmod(engines, stat.S_IREAD)
@ -365,7 +365,7 @@ def create_engine_mmps(arg = 'full'):
except:
macros = os.path.join(local, "macros.mmh")
engines = os.path.join(local, "engines.mmh")
macros_new = os.path.join(local, "macros.mmh.new")
engines_new = os.path.join(local, "engines.mmh.new")
SafeWriteFile(macros_new, 'w', ro_warning)

View file

@ -143,7 +143,7 @@ TARGET ScummVM%s.exe
TARGETPATH sys\\bin
TARGETTYPE exe
OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char \
-fno-asynchronous-unwind-tables -std=c++11 // -ffreestanding -fno-sized-deallocation //--verbose //-flto -fuse-linker-plugin //-Wl, -v -fbuiltin
-fno-asynchronous-unwind-tables -std=c++11 // -ffreestanding -fno-sized-deallocation //--verbose //-flto -fuse-linker-plugin //-Wl, -v -fbuiltin
// fixes error "section .data loaded at [...] overlaps section .text loaded at [...]"
LINKEROPTION GCCE -Tdata 0xAA00000 // -v -flto -fuse-linker-plugin
//--print-gc-sections --stats --gc-sections --strip-all// removes unused code
@ -198,7 +198,7 @@ def SafeWriteFile(path, data, mode = 'w'):
f.write(s + '\n')
else:
f.write(data)
def create_mmps(build, path = ''):
uids = get_UIDs(build)
bld_inf = os.path.join(path, "bld.inf")

View file

@ -209,7 +209,7 @@ SECTIONS
.debug_varnames 0 : { *(.debug_varnames) }
/DISCARD/ : { *(.comment) *(.pdr) }
/DISCARD/ : { *(.note.GNU-stack) }
. = __plugin_hole_start;
.got : { *(.got.plt) *(.got) } : shorts
/* We want the small data sections together, so single-instruction offsets

View file

@ -92,7 +92,7 @@ SECTIONS
KEEP (*(.fini))
. = ALIGN(32); /* REQUIRED. LD is flaky without it. */
} = 0
PROVIDE (__etext = .);
PROVIDE (_etext = .);
PROVIDE (etext = .);
@ -179,7 +179,7 @@ SECTIONS
_edata = .;
PROVIDE (edata = .);
.sbss :
{
__sbss_start = .;

View file

@ -52,7 +52,7 @@ ISpAudio *_audio;
WindowsTextToSpeechManager::WindowsTextToSpeechManager()
: _speechState(BROKEN){
init();
init();
_threadParams.queue = &_speechQueue;
_threadParams.state = &_speechState;
_threadParams.mutex = &_speechMutex;

View file

@ -41,11 +41,11 @@ namespace Common {
/**
* @name Copy templates
* @{
*/
*/
/**
* Copy data from the range [first, last) to [dst, dst + (last - first)).
*
*
* The function requires the range [dst, dst + (last - first)) to be valid.
* It also requires dst not to be in the range [first, last).
*/
@ -58,7 +58,7 @@ Out copy(In first, In last, Out dst) {
/**
* Copy data from the range [first, last) to [dst - (last - first), dst).
*
*
* The function requires the range [dst - (last - first), dst) to be valid.
* It also requires dst not to be in the range [first, last).
*
@ -93,21 +93,21 @@ Out copy_if(In first, In last, Out dst, Op op) {
/**
* @}
*/
*/
/**
* @name Fill templates
* @{
*/
*/
/**
* A 'fill' template for signed char arrays.
*
* Since C++ does not currently support partial specialized template functions,
* Since C++ does not currently support partial specialized template functions,
* this solution is implemented.
* With this template, the usage of memset is assured, which is
* faster than a simple loop like for the generic 'fill'.
*/
*/
template<class Value>
signed char *fill(signed char *first, signed char *last, Value val) {
memset(first, (val & 0xFF), last - first);
@ -117,11 +117,11 @@ signed char *fill(signed char *first, signed char *last, Value val) {
/**
* A 'fill' template for unsigned char arrays.
*
* Since C++ does not currently support partial specialized template functions,
* Since C++ does not currently support partial specialized template functions,
* this solution is implemented.
* With this template, the usage of memset is assured, which is
* faster than a simple loop like for the generic 'fill'.
*/
*/
template<class Value>
unsigned char *fill(unsigned char *first, unsigned char *last, Value val) {
memset(first, (val & 0xFF), last - first);
@ -131,11 +131,11 @@ unsigned char *fill(unsigned char *first, unsigned char *last, Value val) {
/**
* A 'fill' template for char arrays.
*
* Since C++ does not currently support partial specialized template functions,
* Since C++ does not currently support partial specialized template functions,
* this solution is implemented.
* With this template, the usage of memset is assured, which is
* faster than a simple loop like for the generic 'fill'.
*/
*/
template<class Value>
char *fill(char *first, char *last, Value val) {
memset(first, (val & 0xFF), last - first);
@ -149,7 +149,7 @@ char *fill(char *first, char *last, Value val) {
/**
* @name Range templates
* @{
*/
*/
/**
* Set all elements in the range [first, last) to val.
@ -202,7 +202,7 @@ Op for_each(In first, In last, Op f) {
/**
* @}
*/
*/
template<typename T>
unsigned int distance(T *first, T *last) {
@ -256,7 +256,7 @@ T sortPartition(T first, T last, T pivot, StrictWeakOrdering &comp) {
/**
* @name Sorting templates
* @{
*/
*/
/**
* Simple sorting function, modeled after std::sort.

View file

@ -35,7 +35,7 @@ namespace Common {
* @ingroup common
*
* @brief The Archive module allows for managing the members of arbitrary containers in a uniform
* fashion.
* fashion.
* It also supports looking up by names and file names, opening a file, and returning a usable input stream.
* @{
*/

View file

@ -489,7 +489,7 @@ TEMPLATE void BASESTRING::clear() {
_storage[0] = 0;
}
TEMPLATE void BASESTRING::setChar(value_type c, uint32 p) {
assert(p < _size);
@ -610,7 +610,7 @@ TEMPLATE uint64 BASESTRING::asUint64Ext() const {
uint64 result = 0;
uint64 base = 10;
uint32 skip = 0;
if (_size >= 3 && _str[0] == '0' && _str[1] == 'x') {
base = 16;
skip = 2;

View file

@ -46,7 +46,7 @@ CosineTable::CosineTable(int nPoints) {
_tableEOS[i] = cos(i * _radResolution);
for (int i = 1; i < _nPoints / 4; i++)
_tableEOS[_nPoints / 2 - i] = _tableEOS[i];
_tableEOS[_nPoints / 2 - i] = _tableEOS[i];
}
float CosineTable::at(int index) const {

View file

@ -55,7 +55,7 @@ bool decompressDCL(ReadStream *sourceStream, byte *dest, uint32 packedSize, uint
* @overload
*
* Decompress a PKWARE DCL compressed stream.
*
*
* @return Returns a valid pointer if successful or 0 otherwise.
*/
SeekableReadStream *decompressDCL(SeekableReadStream *sourceStream, uint32 packedSize, uint32 unpackedSize);
@ -64,10 +64,10 @@ SeekableReadStream *decompressDCL(SeekableReadStream *sourceStream, uint32 packe
* @overload
*
* Decompress a PKWARE DCL compressed stream.
*
*
* This method is meant for cases, where the unpacked size is not known.
*
* @return Returns a valid pointer if successful or 0 otherwise.
* @return Returns a valid pointer if successful or 0 otherwise.
*/
SeekableReadStream *decompressDCL(SeekableReadStream *sourceStream);

View file

@ -99,7 +99,7 @@ void debugC(int level, uint32 debugChannels, const char *s, ...) GCC_PRINTF(3, 4
* @param level Debug level that must be active for the message to be printed.
* @param debugChannels Bitfield of channels to check against.
* @param s Message to print.
*
*
*/
void debugCN(int level, uint32 debugChannels, const char *s, ...) GCC_PRINTF(3, 4);

View file

@ -32,7 +32,7 @@
*
* @brief Functions and macros for endian conversions and byteswap conversions.
*
* @details
* @details
* - SWAP_BYTES_??(a) - Reverse byte order
* - SWAP_CONSTANT_??(a) - Reverse byte order, implemented as a macro.
* Use with compile-time constants only, the result will be a compile-time constant as well.
@ -393,7 +393,7 @@
/** @name Map functions for reading/writing BE/LE integers depending on native endianess
* @{
*/
#if defined(SCUMM_LITTLE_ENDIAN)
#define READ_LE_UINT16(a) READ_UINT16(a)

View file

@ -29,7 +29,7 @@
// Enable the following #define if you want to check how many collisions the
// code produces (many collisions indicate either a bad hash function, or a
// hash table that is too small).
//#define DEBUG_HASH_COLLISIONS
/**

View file

@ -36,10 +36,10 @@ namespace Common {
* @ingroup common
*
* @brief API for operations related to Huffman bit stream decoding.
*
*
* @details Used in engines:
* - SCUMM
*
*
* @{
*/

View file

@ -37,7 +37,7 @@ namespace Common {
*
* @brief API for operations on IFF container files.
*
*
*
* @{
*/

View file

@ -35,7 +35,7 @@ namespace Common {
*
* @brief API for operations on INI configuration files.
*
*
*
* @{
*/

View file

@ -33,7 +33,7 @@ namespace Common {
*
* @brief API for managing the InstallShield.
*
*
*
* @{
*/

View file

@ -42,7 +42,7 @@ namespace Common {
*
* @brief API for keyboard operations.
*
*
*
* @{
*/

View file

@ -33,7 +33,7 @@ namespace Common {
*
* @brief API for managing game language.
*
*
*
* @{
*/

View file

@ -34,7 +34,7 @@ namespace Common {
*
* @brief Functions for managing localized elements of the GUI.
*
*
*
* @{
*/

View file

@ -255,7 +255,7 @@ class WeakPtr;
* as for a normal pointer. If you need to access the plain pointer value
* itself later on use the get method. The class also supplies a operator
* ->, which does the same as the -> operator on a normal pointer.
*
*
* Be sure you are using new to initialize the pointer you want to manage.
* If you do not use new for allocating, you have to supply a deleter as
* second parameter when creating a SharedPtr object. The deleter has to

View file

@ -48,7 +48,7 @@ struct Point {
int16 y; /*!< The vertical position of the point. */
Point() : x(0), y(0) {}
/**
* Create a point with position defined by @p x1 and @p y1.
*/
@ -154,7 +154,7 @@ struct Rect {
/**
* Create a rectangle with the top-left corner at the given position (x1, y1)
* and the bottom-right corner at the position (x2, y2).
*
*
* The @p x2 value must be greater or equal @p x1 and @p y2 must be greater or equal @p y1.
*/
Rect(int16 x1, int16 y1, int16 x2, int16 y2) : top(y1), left(x1), bottom(y2), right(x2) {
@ -324,7 +324,7 @@ struct Rect {
}
/**
* Move this rectangle to the position defined by @p x, @p y.
* Move this rectangle to the position defined by @p x, @p y.
*/
void moveTo(int16 x, int16 y) {
bottom += y - top;
@ -342,14 +342,14 @@ struct Rect {
}
/**
* Move this rectangle to the position of the point @p p.
* Move this rectangle to the position of the point @p p.
*/
void moveTo(const Point &p) {
moveTo(p.x, p.y);
}
/**
* Print debug messages related to this class.
* Print debug messages related to this class.
*/
void debugPrint(int debuglevel = 0, const char *caption = "Rect:") const {
debug(debuglevel, "%s %d, %d, %d, %d", caption, left, top, right, bottom);

View file

@ -66,12 +66,12 @@ public:
* you must call clearErr() explicitly.
*/
virtual bool err() const;
/**
* Reset the I/O error status as returned by err().
*/
virtual void clearErr();
/**
* Finalize and close this stream. To be called right before this
* stream instance is deleted. The goal here is to enable calling
@ -185,7 +185,7 @@ public:
*
* @param name Name of the save file.
* @param compress Whether to compress the resulting save file (default) or not.
*
*
* @return Pointer to an OutSaveFile, or NULL if an error occurred.
*/
virtual OutSaveFile *openForSaving(const String &name, bool compress = true) = 0;
@ -221,7 +221,7 @@ public:
* @param oldName Old name.
* @param newName New name.
* @param compress Whether to compress the resulting save file (default) or not.
*
*
* @return True if no error occurred, false otherwise.
*/
virtual bool renameSavefile(const String &oldName, const String &newName, bool compress = true);
@ -232,7 +232,7 @@ public:
* @param oldName Old name.
* @param newName New name.
* @param compress Whether to compress the resulting save file (default) or not.
*
*
* @return true if no error occurred. false otherwise.
*/
virtual bool copySavefile(const String &oldName, const String &newName, bool compress = true);

View file

@ -54,14 +54,14 @@ float SineTable::at(int index) const {
return _table[index];
}
float SineTable::atLegacy(int index) const {
float SineTable::atLegacy(int index) const {
assert((index >= 0) && (index < _nPoints));
if (index < _refSize)
// [0,pi/2)
return _tableEOS[index];
if (index == _refSize)
// pi/2
return 1.0f; // sin(pi/2) = 1.0
return 1.0f; // sin(pi/2) = 1.0
if ((index > _refSize) && (index < 2 * _refSize))
// (pi/2,pi)
return _tableEOS[2 * _refSize - index];

View file

@ -68,7 +68,7 @@ public:
* Returns sin(2*pi * index / nPoints )
* Index must be in range [0, nPoints - 1]
*/
float atLegacy(int index) const;
float atLegacy(int index) const;
private:
float *_tableEOS;

View file

@ -797,7 +797,7 @@ void U32String::decodeOneByte(const char *src, uint32 len, CodePage page) {
}
void String::encodeOneByte(const U32String &src, CodePage page, bool transliterate) {
const ReverseTablePrefixTreeLevel1 *conversionTable =
const ReverseTablePrefixTreeLevel1 *conversionTable =
getReverseConversionTable(page);
ensureCapacity(src.size(), false);
@ -848,7 +848,7 @@ void String::encodeInternal(const U32String &src, CodePage page) {
break;
case kWindows932:
encodeWindows932(src);
break;
break;
case kWindows949:
encodeWindows949(src);
break;

View file

@ -102,11 +102,11 @@ public:
virtual bool flush() { return true; }
/**
* Finalize and close this stream.
* Finalize and close this stream.
*
* Call this method right before this stream instance is deleted.
* The goal is to enable the client code to detect
* and handle I/O errors that might occur when closing
* and handle I/O errors that might occur when closing
* (and flushing, if buffered) the stream.
*
* After this method has been called, no further writes can be
@ -132,7 +132,7 @@ public:
* Subclasses need not (and should not) overload them.
* @{
*/
/**
* Write the given byte to the current position in the stream.
*/
@ -240,7 +240,7 @@ public:
/**
* Write a 32-bit floating point value
* stored in big endian order into the stream.
* stored in big endian order into the stream.
*/
FORCEINLINE void writeFloatBE(float value) {
uint32 n;
@ -264,7 +264,7 @@ public:
/**
* Write the given 64-bit floating point value (with decimals)
* Write the given 64-bit floating point value (with decimals)
* stored in big endian order into the stream.
*/
FORCEINLINE void writeDoubleBE(double value) {
@ -304,7 +304,7 @@ public:
class SeekableWriteStream : public WriteStream {
public:
/**
* Set the stream position indicator for the stream.
* Set the stream position indicator for the stream.
*
* The new position, measured in bytes, is obtained by adding offset bytes
* to the position specified by whence. If whence is set to SEEK_SET, SEEK_CUR,
@ -700,7 +700,7 @@ public:
/**
* Skip the given number of bytes in the stream.
*
*
* This is equivalent to calling:
* @code
* seek(offset, SEEK_CUR)

View file

@ -37,7 +37,7 @@ namespace Common {
*
* @{
*/
class String;
/**
@ -190,7 +190,7 @@ private:
void decodeWindows949(const char *src, uint32 len);
void decodeWindows950(const char *src, uint32 len);
void decodeUTF8(const char *str, uint32 len);
friend class String;
};

View file

@ -307,7 +307,7 @@ bool isBlank(int c);
/**
* Represent the size of a file in bytes as a number with floating point and
* largest suitable units. For example, 1474560 bytes as 1.4 MB.
*
*
* @param[in] bytes Size in bytes to be represented.
* @param[out] unitsOut String with units.
*

View file

@ -41,7 +41,7 @@ namespace Common {
* @ingroup common
*
* @brief The XML parser allows for parsing XML-like files.
*
*
* @{
*/

View file

@ -32,7 +32,7 @@ namespace Common {
* @ingroup common
*
* @brief API for zlib operations.
*
*
* @{
*/

View file

@ -98,9 +98,9 @@ create_supernova (criezy)
create_toon (Strangerke)
-----------
This tool creates toon.dat, which contains all the game's texts
This tool creates toon.dat, which contains all the game's texts
hardcoded in original game executable. This includes English, French,
German, Russian and Spanish texts.
German, Russian and Spanish texts.
create_translations (criezy)

View file

@ -59,7 +59,7 @@ You need to follow these instructions:
3. Create an overrideEncodingSUBLTS.txt file in the sampleInput folder. This is a configuration file for the font file creation. A sample is provided in the sampleInput folder and documentation about this is below in this document (see "override encoding text file" in fontCreator).
4. Create a configureFontsTranslation.txt in the sampleInput folder. A configuration file for the MIX file creation. A sample is provided in the sampleInput folder and documentation about this is below in this document (see "text configuration file" in mixResourceCreator).
4. Create a configureFontsTranslation.txt in the sampleInput folder. A configuration file for the MIX file creation. A sample is provided in the sampleInput folder and documentation about this is below in this document (see "text configuration file" in mixResourceCreator).
5. From the ScummVM root folder run:
```bash
@ -93,7 +93,7 @@ Syntax Notes:
3. The "-ian" optional switch is followed by the path to the actornames.txt file -- if this is omitted then the file is assumed to reside in the current working directory.
4. The "-ld" optional switch is followed by a language description for the language of the game you are exporting Text Resources from. This switch is meaningful when you also use the "-xtre" switch to export Text Resource files.
* Valid language values are: EN\_ANY, DE\_DEU, FR\_FRA, IT\_ITA, ES\_ESP, RU\_RUS
* Valid language values are: EN\_ANY, DE\_DEU, FR\_FRA, IT\_ITA, ES\_ESP, RU\_RUS
* Default language value is: EN\_ANY (English)
@ -107,7 +107,7 @@ Syntax Notes:
9. You may use all, a subset or none of the "-xwav", "-xtre", "-xpogo", "-xdevs" switches, depending on what you need to do.
10. The "--trace" optional switch enables extra debug messages to be printed.
10. The "--trace" optional switch enables extra debug messages to be printed.
Usage:
```bash
@ -128,7 +128,7 @@ python2.7 mixResourceCreator.py -x excelWithTranscriptSheets.xlsx [-ian pathToAc
The tool __requires__ a valid path to the actornames.txt file, which is included in the samples folder.
Syntax Notes:
Syntax Notes:
1. The "-x" switch is followed by the path to the input Excel file (xls or xlsx) which should contain the transcript sheet(s).
@ -141,7 +141,7 @@ Syntax Notes:
* Default language value is: EN\_ANY (English)
5. The "--trace" optional switch enables extra debug messages to be printed.
5. The "--trace" optional switch enables extra debug messages to be printed.
The __text configuration file "configureFontsTranslation.txt"__ is a __text file that should be saved in a UTF-8 encoding (no BOM)__, that contains the following:
@ -157,7 +157,7 @@ The __text configuration file "configureFontsTranslation.txt"__ is a __text file
* a list of comma separated tuples that specify the mapping of special (out of order) character to placeholder characters from the selected codepage. See fontCreator section for more details on this.
* For example:
* For example:
```text
fontNameAndOutOfOrderGlyphs=SUBTLS_E#windows-1253#í:Ά,ñ:¥,â:¦,é:§,Ά:£
fontNameAndOutOfOrderGlyphs=KIA6PT#cp437#
@ -165,9 +165,9 @@ The __text configuration file "configureFontsTranslation.txt"__ is a __text file
fontNameAndOutOfOrderGlyphs=SYSTEM#latin-1#
```
Note: for font files (FON) that you have created or edited with the fontCreator tool (e.g for the "SUBTLS\_E.FON" file for subtitles, or another in-game font file eg. KIA6PT, TAHOMA) you __should copy the 8-bit encoding and the comma separated out of order character tuples from the respective "override encoding" text file that you used with the fontCreator tool for each new/ edited font in the configureFontsTranslation.txt fields__.
Note: for font files (FON) that you have created or edited with the fontCreator tool (e.g for the "SUBTLS\_E.FON" file for subtitles, or another in-game font file eg. KIA6PT, TAHOMA) you __should copy the 8-bit encoding and the comma separated out of order character tuples from the respective "override encoding" text file that you used with the fontCreator tool for each new/ edited font in the configureFontsTranslation.txt fields__.
Additionally, __all the new and edited fonts (FON files that were output by the fontCreator script) should be in your working directory__ in order to include them in the SUBTITLES.MIX.
Additionally, __all the new and edited fonts (FON files that were output by the fontCreator script) should be in your working directory__ in order to include them in the SUBTITLES.MIX.
It's important to keep the naming of those files unchanged. __Supported name values for imported FON files__ are: SUBTLS\_E.FON, KIA6PT.FON, TAHOMA18.FON, TAHOMA24.FON and SYSTEM.FON (practically you won't be using the last one).
@ -205,7 +205,7 @@ The override encoding file is a __text file that should be saved in a UTF-8 enco
* You don't need to use all the characters of the specified codepage in your "all-characters" string.
* For any special characters that don't appear in the target codepage (eg ñ, é, í, â don't appear in the Greek codepage), you'll have to decide on an ASCII value for them (one not used by another character appearing in-game).
* For any special characters that don't appear in the target codepage (eg ñ, é, í, â don't appear in the Greek codepage), you'll have to decide on an ASCII value for them (one not used by another character appearing in-game).
* In the "all-characters" string you should put as placeholders the actual characters from the specified codepage that correspond to the ASCII values you have decided above; The placeholder characters should also be in the proper order (by their ASCII value) inside the string.
@ -220,7 +220,7 @@ The override encoding file is a __text file that should be saved in a UTF-8 enco
* Don't use space(s) between the tuples!
5. A key "originalFontName" with the FON file's original name in the game (the one that it should replace). Use SUBLTS for the subtitles FON.
* Example: originalFontName=SUBLTS
* Example: originalFontName=SUBLTS
6. A key "specialOutOfOrderGlyphsUTF8ToAsciiTargetEncoding" with value a list of comma separated tuples that indicates which character glyphs should replace the placeholder glyphs in your all-character string above.
* Example: specialOutOfOrderGlyphsUTF8ToAsciiTargetEncoding=í:Ά,ñ:¥,â:¦,é:§,Ά:£
@ -258,12 +258,12 @@ __For the creation of subtitles' font mode__, there are six (6) mandatory launch
6. whiteSpaceWidthInPixels: This is a positive integer value that sets the width in pixels for the single white space between words for the subtitles in-game.
The "--trace" optional switch enables extra debug messages to be printed.
The "--trace" optional switch enables extra debug messages to be printed.
A suggested method of creating decent looking PNG with the row of glyphs for your subtitles' font is the following:
1. Create the font row in __GIMP__
* Start with a __new__ empty image, with transparent background. Choose a large enough canvas width (you can adjust it later)
* Start with a __new__ empty image, with transparent background. Choose a large enough canvas width (you can adjust it later)
* Paste as a new layer a tab separated alphanumeric sequence with all your glyphs (as specified above). Choose white as the font's color.
@ -281,9 +281,9 @@ A suggested method of creating decent looking PNG with the row of glyphs for you
6. Finally, place this completely black colored layer underneath the other one and __merge the visible__ layers.
7. Export your image to a PNG file.
7. Export your image to a PNG file.
This should get rid of semi-transparent pixels while maintaining the "aliasing" effect.
This should get rid of semi-transparent pixels while maintaining the "aliasing" effect.
There could be a better way but this should work ok.
## Credits and Special Thanks

View file

@ -21,12 +21,12 @@ class sbtlVersTextResource:
def __init__(self, traceModeEnabled = True):
self.m_traceModeEnabled = traceModeEnabled
return
def printSbtlVersTemplate(self):
for (idTre, textTre) in SBTLVERS_TEXT_RESOURCE_TUPLE_LIST:
print "%s\t%s" % (idTre, textTre)
return
def getSbtlVersEntriesList(self):
return SBTLVERS_TEXT_RESOURCE_TUPLE_LIST
@ -36,9 +36,8 @@ if __name__ == '__main__':
traceModeEnabled = False
sbtlVersTRInstance = sbtlVersTextResource(traceModeEnabled)
sbtlVersTRInstance.printSbtlVersTemplate()
else:
#debug
#print "[Debug] Running %s imported from another module" % (my_module_name)
pass

View file

@ -468,7 +468,7 @@ class vqasTextResource(object):
def __init__(self, traceModeEnabled = True):
self.m_traceModeEnabled = traceModeEnabled
return
def printAllVqasTextResource(self):
if self.m_traceModeEnabled:
print "[Trace] printing all VQAs Text"
@ -477,7 +477,7 @@ class vqasTextResource(object):
for (startFrameTre, endFrameTre, textTre, timeStartTre, timeEndTre, byActorTre) in vqaTreList:
print "%s\t%s\t%s\t%s\t%s\t%s" % (startFrameTre, endFrameTre, textTre, timeStartTre, timeEndTre, byActorTre)
return
def getVqaEntriesList(self, sVQASheetPrefix):
if self.m_traceModeEnabled:
print "[Trace] getVqaEntriesList()"
@ -498,4 +498,3 @@ else:
#debug
#print "[Debug] Running %s imported from another module" % (my_module_name)
pass

View file

@ -13,7 +13,7 @@ except ImportError:
print "[Error] os python library is required to be installed!"
else:
osLibFound = True
try:
import sys
except ImportError:
@ -27,7 +27,7 @@ except ImportError:
print "[Error] struct python library is required to be installed!"
else:
structLibFound = True
try:
from PIL import Image
except ImportError:
@ -52,23 +52,23 @@ class FonHeader(object):
maxGlyphWidth = -1 # in pixels
maxGlyphHeight = -1 # in pixels
graphicSegmentByteSize = -1 # Graphic segment byte size
def __init__(self):
return
class fonFile(object):
m_header = FonHeader()
simpleFontFileName = 'GENERIC.FON'
realNumOfCharactersInImageSegment = 0 # this is used for the workaround for the corrupted TAHOME18.FON
nonEmptyCharacters = 0
glyphDetailEntriesLst = [] # list of 5-value tuples. Tuple values are (X-offset, Y-offset, Width, Height, Offset in Graphics segment)
glyphPixelData = None # buffer of pixel data for glyphs
m_traceModeEnabled = False
# traceModeEnabled is bool to enable more printed debug messages
def __init__(self, traceModeEnabled = True):
del self.glyphDetailEntriesLst[:]
@ -77,12 +77,12 @@ class fonFile(object):
self.realNumOfCharactersInImageSegment = 0 # this is used for the workaround for the corrupted TAHOME18.FON
self.nonEmptyCharacters = 0
self.m_traceModeEnabled = traceModeEnabled
return
def loadFonFile(self, fonBytesBuff, maxLength, fonFileName):
self.simpleFontFileName = fonFileName
offsInFonFile = 0
localLstOfDataOffsets = []
del localLstOfDataOffsets[:]
@ -93,26 +93,26 @@ class fonFile(object):
tmpTuple = struct.unpack_from('I', fonBytesBuff, offsInFonFile) # unsigned integer 4 bytes
self.header().maxEntriesInTableOfDetails = tmpTuple[0]
offsInFonFile += 4
if self.simpleFontFileName == 'TAHOMA18.FON': # deal with corrupted original 'TAHOMA18.FON' file
self.realNumOfCharactersInImageSegment = 176
if self.m_traceModeEnabled:
print "[Debug] SPECIAL CASE. WORKAROUND FOR CORRUPTED %s FILE. Only %d characters supported!" % (self.simpleFontFileName, self.realNumOfCharactersInImageSegment)
else:
self.realNumOfCharactersInImageSegment = self.header().maxEntriesInTableOfDetails
tmpTuple = struct.unpack_from('I', fonBytesBuff, offsInFonFile) # unsigned integer 4 bytes
self.header().maxGlyphWidth = tmpTuple[0]
offsInFonFile += 4
tmpTuple = struct.unpack_from('I', fonBytesBuff, offsInFonFile) # unsigned integer 4 bytes
self.header().maxGlyphHeight = tmpTuple[0]
offsInFonFile += 4
tmpTuple = struct.unpack_from('I', fonBytesBuff, offsInFonFile) # unsigned integer 4 bytes
self.header().graphicSegmentByteSize = tmpTuple[0]
offsInFonFile += 4
if self.m_traceModeEnabled:
print "[Debug] Font file (FON) Header Info: "
print "[Debug] Number of entries: %d, Glyph max-Width: %d, Glyph max-Height: %d, Graphic Segment size: %d" % (self.header().maxEntriesInTableOfDetails, self.header().maxGlyphWidth, self.header().maxGlyphHeight, self.header().graphicSegmentByteSize)
@ -127,23 +127,23 @@ class fonFile(object):
tmpTuple = struct.unpack_from('i', fonBytesBuff, offsInFonFile) # unsigned integer 4 bytes
tmpXOffset = tmpTuple[0]
offsInFonFile += 4
tmpTuple = struct.unpack_from('I', fonBytesBuff, offsInFonFile) # unsigned integer 4 bytes
tmpYOffset = tmpTuple[0]
offsInFonFile += 4
tmpTuple = struct.unpack_from('I', fonBytesBuff, offsInFonFile) # unsigned integer 4 bytes
tmpWidth = tmpTuple[0]
offsInFonFile += 4
tmpTuple = struct.unpack_from('I', fonBytesBuff, offsInFonFile) # unsigned integer 4 bytes
tmpHeight = tmpTuple[0]
offsInFonFile += 4
tmpTuple = struct.unpack_from('I', fonBytesBuff, offsInFonFile) # unsigned integer 4 bytes
tmpDataOffset = tmpTuple[0]
offsInFonFile += 4
if tmpWidth == 0 or tmpHeight == 0:
if self.m_traceModeEnabled:
print "Index: %d\t UNUSED *****************************************************************" % (idx)
@ -157,9 +157,9 @@ class fonFile(object):
# This never happens in the original files. Offsets are "re-used" but not really because it happens only for empty (height = 0) characters which all seem to point to the next non-empty character
if self.m_traceModeEnabled:
print "Index: %d\t RE-USING ANOTHER GLYPH *****************************************************************" % (idx)
self.glyphDetailEntriesLst.append( ( tmpXOffset, tmpYOffset, tmpWidth, tmpHeight, tmpDataOffset) )
offsInFonFile = (4 * 4) + (self.header().maxEntriesInTableOfDetails * 5 * 4) # we need the total self.header().maxEntriesInTableOfDetails here and not self.realNumOfCharactersInImageSegment
self.glyphPixelData = fonBytesBuff[offsInFonFile:]
return True
@ -167,31 +167,31 @@ class fonFile(object):
print "[Error] Loading Font file (FON) %s failed!" % (self.simpleFontFileName)
raise
return False
def outputFonToPNG(self):
print "[Info] Exporting font file (FON) to PNG: %s" % (self.simpleFontFileName + ".PNG")
targWidth = 0
targHeight = 0
paddingFromTopY = 2
paddingBetweenGlyphsX = 10
if len(self.glyphDetailEntriesLst) == 0 or (len(self.glyphDetailEntriesLst) != self.realNumOfCharactersInImageSegment and len(self.glyphDetailEntriesLst) != self.header().maxEntriesInTableOfDetails) :
print "[Error] Font file (FON) loading process did not complete correctly. Missing important data in structures. Cannot output image!"
return
# TODO asdf refine this code here. the dimensions calculation is very crude for now
if self.header().maxGlyphWidth > 0 :
targWidth = (self.header().maxGlyphWidth + paddingBetweenGlyphsX) * (self.realNumOfCharactersInImageSegment + 1)
else:
targWidth = 1080
# TODO asdf refine this code here. the dimensions calculation is very crude for now
if self.header().maxGlyphHeight > 0 :
targHeight = self.header().maxGlyphHeight * 2
else:
targHeight = 480
imTargetGameFont = Image.new("RGBA",(targWidth, targHeight), (0,0,0,0))
#print imTargetGameFont.getbands()
#
@ -213,12 +213,12 @@ class fonFile(object):
if (glyphWidth == 0 or glyphHeight == 0):
drawIdxDeductAmount += 1
drawIdx = idx - drawIdxDeductAmount
for colorIdx in range(0, glyphWidth*glyphHeight):
tmpTuple = struct.unpack_from('H', self.glyphPixelData, glyphDataOffs) # unsigned short 2 bytes
pixelColor = tmpTuple[0]
glyphDataOffs += 2
# if pixelColor > 0x8000:
# print "[Debug] WEIRD CASE" # NEVER HAPPENS - TRANSPARENCY IS ON/OFF. There's no grades of transparency
rgbacolour = (0,0,0,0)
@ -230,18 +230,18 @@ class fonFile(object):
tmp8bitB1 = ( (pixelColor & 0x1f) ) << 3
rgbacolour = (tmp8bitR1,tmp8bitG1,tmp8bitB1, 255) # alpha: 1.0 fully opaque
#rgbacolour = (255,255,255, 255) # alpha: 1.0 fully opaque
if currX == glyphWidth:
currX = 0
currY += 1
imTargetGameFont.putpixel(( (drawIdx + 1) * (self.header().maxGlyphWidth + paddingBetweenGlyphsX ) + currX, paddingFromTopY + glyphYoffs + currY), rgbacolour)
currX += 1
try:
imTargetGameFont.save(os.path.join('.', self.simpleFontFileName + ".PNG"), "PNG")
except Exception as e:
print '[Error] Unable to write to output PNG file. ' + str(e)
def header(self):
return self.m_header
#
@ -259,7 +259,7 @@ if __name__ == '__main__':
# 'SUBTLS_E.FON' # OUR EXTRA FONT USED FOR SUBTITLES
inFONFile = None
inFONFileName = 'SUBTLS_E.FON' # Subtitles font custom
if len(sys.argv[1:]) > 0 \
and os.path.isfile(os.path.join('.', sys.argv[1])) \
and len(sys.argv[1]) >= 5 \
@ -271,7 +271,7 @@ if __name__ == '__main__':
else:
print "[Error] No valid input file argument was specified and default input file %s is missing." % (inFONFileName)
errorFound = True
if not errorFound:
try:
print "[Info] Opening %s" % (inFONFileName)

View file

@ -74,46 +74,46 @@ imagePilLibFound = False
reLibFound = False
try:
import os
import os
except ImportError:
print "[Error] os python library is required to be installed!"
print "[Error] os python library is required to be installed!"
else:
osLibFound = True
try:
import sys
import sys
except ImportError:
print "[Error] sys python library is required to be installed!"
print "[Error] sys python library is required to be installed!"
else:
sysLibFound = True
try:
import shutil
import shutil
except ImportError:
print "[Error] Shutil python library is required to be installed!"
print "[Error] Shutil python library is required to be installed!"
else:
shutilLibFound = True
try:
import struct
import struct
except ImportError:
print "[Error] struct python library is required to be installed!"
print "[Error] struct python library is required to be installed!"
else:
structLibFound = True
try:
from PIL import Image
except ImportError:
print "[Error] Image python library (PIL) is required to be installed!"
print "[Error] Image python library (PIL) is required to be installed!"
else:
imagePilLibFound = True
try:
import re
import re
except ImportError:
print "[Error] re (Regular expression operations) python library is required to be installed!"
print "[Error] re (Regular expression operations) python library is required to be installed!"
else:
reLibFound = True
reLibFound = True
if (not osLibFound) \
or (not sysLibFound) \
@ -244,7 +244,7 @@ class grabberFromPNG:
if linesLst is None or len(linesLst) == 0:
overrideFailed = True
else:
if gTraceModeEnabled:
if gTraceModeEnabled:
print "[Debug] Parsing Override Encoding file info..."
involvedTokensLst =[]
del involvedTokensLst[:] # unneeded
@ -578,20 +578,20 @@ class grabberFromPNG:
# print "[Debug] xOffSet: ", startCol - (self.startOfAllLettersIncludingTheExtraDoubleAndWithKern + (self.lettersFound + 1) * self.tabSpaceWidth)
else:
self.listOfXOffsets.append(0)
self.listOfBaselines.append(endRow)
self.listOfWidths.append(endCol-startCol + 1) # includes the last col (TODO this was without the +1 for MI:SE translator -- possible bug? did we compensate?)
self.listOfHeights.append(endRow - startRow + 1) # +1 includes the last row
self.listOfLetterBoxes.append((startCol, startRow, endCol, endRow))
self.startColOfPrevFontLetter = startCol #update for next pass
#delete the letter - even in the case of ignoring the first double letter
for x in range(startCol, endCol+1):
for y in range(startRow - trimTopPixels, endRow+1 + trimBottomPixels):
loadedImag[x, y] = 0, 0, 0, 0
return 0
else:
else:
return -1
#
#
@ -743,7 +743,7 @@ class grabberFromPNG:
print '[Error] Failed to create target font (FON) file: ' + self.targetFONFilename + '::' + str(e)
errorFound = True
if not errorFound:
print '[Info] Creating target font (FON) file: ' + self.targetFONFilename
print '[Info] Creating target font (FON) file: ' + self.targetFONFilename
# reopen the image with our Fonts because we deleted the letters in the in-mem copy
im = None
if os.access(self.imageRowFilePNG, os.F_OK) :
@ -1019,11 +1019,11 @@ class grabberFromPNG:
if filename.upper() == mixFileName:
inputMIXFilesFound.append(mixFileName)
break
if len(inputMIXFilesFound) == 0:
print "[Error] No supported game archive resource files (MIX) were found in the specified input path (-ip switch)"
sys.exit(1)
for tmpMIXfileName in inputMIXFilesFound:
print "[Info] Found MIX file: %s" % ('"' + tmpMIXfileName + '"')
errorFound = False
@ -1063,7 +1063,7 @@ class grabberFromPNG:
#
if gTraceModeEnabled:
print "[Debug] Checking for supported font file (FON) entries in MIX file..."
for i in range(0, numOfEntriesToExport):
foundFONFile = False
currFonFileName = 'UNKNOWN.FON'
@ -1213,7 +1213,7 @@ def main(argsCL):
elif argsCL[i][:1] == '-':
invalidSyntax = True
break
if (exportFonMode == False) and (not TMPTargetFONfilename or not TMPimageRowFilePNG or TMPminSpaceBetweenLettersInRowLeftToLeft <= 0 or TMPminSpaceBetweenLettersInColumnTopToTop <= 0 or TMPkerningForFirstDummyFontLetter <= 0 or TMPSpaceWidthInPixels <= 0) : # this argument is mandatory
invalidSyntax = True
@ -1260,7 +1260,7 @@ def main(argsCL):
continue
print "Argument: %s" % (tmpArg)
tmpi+=1
#
# #########################

View file

@ -97,7 +97,7 @@ except ImportError:
print "[Error] struct python library is required to be installed!"
else:
structLibFound = True
if (not osLibFound) \
@ -793,7 +793,7 @@ def inputXLS(pathtoInputExcelFilename):
if gTraceModeEnabled:
print '[Debug] Sheet: %s was not found. Creating a temporary sheet for version info...' % (SUPPORTED_DIALOGUE_VERSION_SHEET)
sbtlVersTRInstance = sbtlVersTextResource(gTraceModeEnabled)
bookCopy = copy(xl_workbook)
bookCopy = copy(xl_workbook)
xl_sheet = bookCopy.add_sheet(SUPPORTED_DIALOGUE_VERSION_SHEET)
n = 0
col1_name = 'Subtitles Version Info'

View file

@ -14,7 +14,7 @@ INPUT_TRANSCRIPT_FILEPATH := $(BLADERUNNER_SUBTITLES_SAMPLE_INPUT_FOLDER)/$(INPU
ifeq (,$(wildcard $(INPUT_TRANSCRIPT_FILEPATH)))
INPUT_TRANSCRIPT_FILENAME := englishTranscript.xlsx
INPUT_TRANSCRIPT_FILEPATH := $(BLADERUNNER_SUBTITLES_SAMPLE_INPUT_FOLDER)/$(INPUT_TRANSCRIPT_FILENAME)
INPUT_TRANSCRIPT_FILEPATH := $(BLADERUNNER_SUBTITLES_SAMPLE_INPUT_FOLDER)/$(INPUT_TRANSCRIPT_FILENAME)
endif
INPUT_TRANSCRIPT_AUX_CONF_FILENAME := configureFontsTranslation.txt
@ -38,7 +38,7 @@ $(FONT_OUTPUT): $(BLADERUNNER_SUBTITLES_SAMPLE_INPUT_FOLDER)/$(INPUT_FONT_GLYPHS
$(info This is an intermediate file. You don't need to copy this in your Blade Runner game directory)
$(info ---------)
$(BLADERUNNER_SUBTITLES_SCRIPTS_ROOT_FOLDER)/fontCreator/fontCreator.py -im $(BLADERUNNER_SUBTITLES_SAMPLE_INPUT_FOLDER)/$(INPUT_FONT_GLYPHS_PNG_FILENAME) -oe $(BLADERUNNER_SUBTITLES_SAMPLE_INPUT_FOLDER)/$(INPUT_FONT_GLYPHS_PNG_AUX_CONF_FILENAME) -om $(FONT_OUTPUT) -pxLL 42 -pxTT 30 -pxKn 1 -pxWS 7
# Creation of final output mix file SUBTILES.MIX
# The MIX file will pack the fonts file $(FONT_OUTPUT) as well as resources created from the transcript (EXCEL) file $(INPUT_TRANSCRIPT_FILENAME)
# The $(INPUT_TRANSCRIPT_AUX_CONF_FILENAME) file is used to configure the creation of the mix file

View file

@ -14,7 +14,7 @@ else:
if (not ctypesLibFound):
sys.stdout.write("[Error] Errors were found when trying to import required python libraries\n")
sys.exit(1)
from struct import *
MY_MODULE_VERSION = "0.60"
@ -49,12 +49,12 @@ def aud_decode_ima_chunk(audioBufferIn, index, sample, cs_chunk):
code = -1
delta = -1
step = -1
audioBufferOut = []
#for i in range(0, len(audioBufferIn)):
#if self.m_traceModeEnabled:
# print '[Debug] %d: %d'%(i, int(audioBufferIn[i]))
for sample_index in range (0, cs_chunk):
try:
code = audioBufferIn[sample_index >> 1]
@ -117,7 +117,7 @@ def aud_decode_ws_chunk(inputChunkBuffer, cb_s, cb_d):
#binDataOut = struct.pack('b'*len(outputChunkBuffer), *outputChunkBuffer)
#return binDataOut
return outputChunkBuffer
# const xccTHA::byte* s_end = inputChunkBuffer + cb_s; # FIX
s_end = inpChBuffIter + cb_s
@ -197,17 +197,17 @@ class audFileDecode(object):
m_index = -1
m_sample = -1
m_traceModeEnabled = False
# traceModeEnabled is bool to enable more printed debug messages
def __init__(self, traceModeEnabled = True, index = 0, sample = 0):
self.m_traceModeEnabled = traceModeEnabled
self.m_index = index;
self.m_sample = sample;
return
def index(self):
return self.m_index
# (const xccTHA::byte* audio_in, short* audio_out, int cs_chunk)
def decode_chunk(self, audio_in, cs_chunk):
(audio_Out, outIndex, outSample) = aud_decode_ima_chunk(audio_in, self.m_index, self.m_sample, cs_chunk)
@ -220,7 +220,7 @@ if __name__ == '__main__':
decodeInstance = audFileDecode()
if decodeInstance.m_traceModeEnabled:
print "[Debug] Running %s (%s) as main module" % (MY_MODULE_NAME, MY_MODULE_VERSION)
else:
#debug
#print "[Debug] Running %s (%s) imported from another module" % (MY_MODULE_NAME, MY_MODULE_VERSION)

View file

@ -14,7 +14,7 @@ except ImportError:
print "[Error] os python library is required to be installed!"
else:
osLibFound = True
try:
import sys
except ImportError:
@ -61,21 +61,21 @@ class AudHeader(object):
m_flags = 0 # bit 0=stereo, bit 1=16bit // int8_t
m_compression = 0 # 1=WW compressed, 99=IMA ADPCM (0x63) // int8_t
m_populated = False
def __init__(self):
return
# The rest of the AUD files is divided in chunks.
# These are usually 512 bytes long, except for the last one.
class AudChunkHeader(object):
m_ch_size_in = 0 # Size of compressed data // int16_t // TODO should be unsigned (?)
m_ch_size_out = 0 # Size of output data // int16_t // TODO should be unsigned (?)
m_ch_id = 0x0000FFFF # Always 0x0000DEAF // int32_t
def __init__(self):
return
#
#
#
@ -83,21 +83,21 @@ class audFile(object):
m_header = AudHeader()
m_traceModeEnabled = False
m_simpleAudioFileName = 'GENERIC.AUD'
# traceModeEnabled is bool to enable more printed debug messages
def __init__(self, traceModeEnabled = True):
self.m_simpleAudioFileName = 'GENERIC.AUD'
self.m_traceModeEnabled = traceModeEnabled
return
# std::fstream& fs, AudFileNS::pos_type startAudFilepos, AudFileNS::pos_type endAudFilepos, const std::string& filename
def export_as_wav(self, audBytesBuff, filename):
if (not self.header().m_populated):
print "[Error] file was not loaded properly (header info missing): " + filename
return 1
print "[Info] Exporting to wav: " + filename
cvirtualBinaryD = None
if self.header().m_compression > 0:
cvirtualBinaryD = self.decode(self.header().m_compression, audBytesBuff)
@ -114,16 +114,16 @@ class audFile(object):
cbinaryDataOutLst.append(tmpTupleL[0])
cbinaryDataOutLst.append(tmpTupleH[0])
cvirtualBinaryD = struct.pack('B'*len(cbinaryDataOutLst), *cbinaryDataOutLst)
if (not cvirtualBinaryD and (len(audBytesBuff) - SIZE_OF_AUD_HEADER_IN_BYTES) > 0):
print "[Error] audio file could not be exported properly (0 data read): %s" % (filename)
return 1
elif (len(audBytesBuff) - SIZE_OF_AUD_HEADER_IN_BYTES) == 0:
print "[Warning] Creating empty wav file: %s" % (filename)
cb_sample = self.get_cb_sample()
cs_remaining = self.get_c_samples()
waveWritFile = wave.open(filename, 'wb')
waveWritFile.setnchannels(self.get_c_channels())
waveWritFile.setsampwidth(cb_sample)
@ -132,7 +132,7 @@ class audFile(object):
#waveWritFile.setcomptype(None, '')
waveWritFile.writeframesraw(cvirtualBinaryD)
waveWritFile.close()
# t_wav_header header;
# memset(&header, 0, sizeof(t_wav_header));
# header.file_header.id = wav_file_id; // # "RIFF"
@ -151,8 +151,8 @@ class audFile(object):
# error = f.write(&header, sizeof(t_wav_header));
# return error ? error : f.write(d);
return 0 # TODO fix
def loadAudFile(self, audBytesBuff, maxLength, audFileName):
self.m_simpleAudioFileName = audFileName
offsInAudFile = 0
@ -171,10 +171,10 @@ class audFile(object):
tmpTuple = struct.unpack_from('B', audBytesBuff, offsInAudFile)
self.header().m_compression = tmpTuple[0]
offsInAudFile += 1
if self.m_traceModeEnabled:
print "[Debug] Sample rate: %d\tsizeIn: %d\tsizeOut: %d\tflags: %d\tcompression: %d" % (self.get_samplerate(), self.header().m_size_in, self.header().m_size_out, self.header().m_flags, self.header().m_compression)
if self.get_samplerate() < 8000 or self.get_samplerate() > 48000 or self.header().m_size_in > (maxLength - SIZE_OF_AUD_HEADER_IN_BYTES ):
print "[Warning] Bad AUD Header info in file %s, size_in: %d, maxLen: %d" % (self.m_simpleAudioFileName, self.header().m_size_in, (maxLength - SIZE_OF_AUD_HEADER_IN_BYTES))
if self.header().m_size_in == 0:
@ -200,7 +200,7 @@ class audFile(object):
return False
self.header().m_populated = True
return True
# int AudFile::get_chunk_header(int i, std::fstream& fs, AudFileNS::pos_type startAudFilepos, AudFileNS::pos_type endAudFilepos, AudChunkHeader& outAudChunkHeader)
def get_chunk_header(self, chunkIdx, inAudFileBytesBuffer, inAudFileSize):
#fs.seekg(int(startAudFilepos) + int(SIZE_OF_AUD_HEADER_IN_BYTES), fs.beg);
@ -208,7 +208,7 @@ class audFile(object):
#rAudPos = fs.tellg();
outAudChunkHeader = AudChunkHeader()
rAudPos = SIZE_OF_AUD_HEADER_IN_BYTES
if (self.m_traceModeEnabled):
print "[Trace] Getting chunk header at %d" % (rAudPos)
#AudChunkHeader tmpInremediateChunkheader;
@ -218,7 +218,7 @@ class audFile(object):
chunkIdx -= 1
if (rAudPos + SIZE_OF_AUD_CHUNK_HEADER_IN_BYTES > inAudFileSize):
return (-1, rAudPos, None)
tmpAudFileOffset = rAudPos
tmpTuple = struct.unpack_from('H', inAudFileBytesBuffer, tmpAudFileOffset)
tmpInremediateChunkheader.m_ch_size_in = tmpTuple[0]
@ -232,7 +232,7 @@ class audFile(object):
#fs.read((char*)&tmpInremediateChunkheader, SIZE_OF_AUD_CHUNK_HEADER_IN_BYTES);
rAudPos += SIZE_OF_AUD_CHUNK_HEADER_IN_BYTES + tmpInremediateChunkheader.m_ch_size_in
#fs.seekg(int(rAudPos), fs.beg);
if (rAudPos + SIZE_OF_AUD_CHUNK_HEADER_IN_BYTES > inAudFileSize ):
return (-1, rAudPos, None)
# write to FINAL output chunk header
@ -251,7 +251,7 @@ class audFile(object):
return (-1, rAudPos, None)
rAudPos += SIZE_OF_AUD_CHUNK_HEADER_IN_BYTES
return (0, rAudPos, outAudChunkHeader) # //reinterpret_cast<const AudChunkHeader*>(r);
# int AudFile::get_chunk_data(int i, std::fstream& fs, int sizeToRead, AudFileNS::byte* byteChunkDataPtr)
def get_chunk_data(self, inAudFileBytesBuffer, startOffs, sizeToRead):
#fs.read((char*)byteChunkDataPtr, sizeToRead)
@ -267,8 +267,8 @@ class audFile(object):
#byteChunkDataOut = struct.pack('b'*len(outChunkDataLst), *outChunkDataLst)
#return (0, byteChunkDataOut)
return (0, outChunkDataLst)
# std::fstream& fs, AudFileNS::pos_type startAudFilepos, AudFileNS::pos_type endAudFilepos
# returned Cvirtual_binary
def decode(self, speccompression, audBytesBuff):
@ -295,7 +295,7 @@ class audFile(object):
if self.m_traceModeEnabled:
print "[Trace] Error OR End file case while getting uncompressed chunk header!"
break
if self.m_traceModeEnabled:
print "[Trace] Get uncompressed chunk header returned: %d " % (out_chunk_header.m_ch_id)
#Cvirtual_binary out_chunk_data;
@ -347,20 +347,20 @@ class audFile(object):
else: #if binaryDataOutBuff is None:
print "[Error] Decoding yielded errors (data out buffer is null)."
return binaryDataOutBuff
def header(self):
return self.m_header
def get_c_samples(self):
return self.m_header.m_size_out / self.get_cb_sample()
def get_samplerate(self):
return self.m_header.m_samplerate;
# flag bit 0 is stereo(set) mono(clear)
def get_c_channels(self):
return 2 if (self.m_header.m_flags & 0x01) else 1;
# flag bit 1 is 16bit(set) 8bit (clear)
def get_cb_sample(self):
return 2 if (self.m_header.m_flags & 0x02) else 1
@ -374,7 +374,7 @@ if __name__ == '__main__':
# otherwise tries to use the first command line argument as input file
inAUDFile = None
inAUDFileName = '00000000.AUD'
if len(sys.argv[1:]) > 0 \
and os.path.isfile(os.path.join('.', sys.argv[1])) \
and len(sys.argv[1]) >= 5 \
@ -386,7 +386,7 @@ if __name__ == '__main__':
else:
print "[Error] No valid input file argument was specified and default input file %s is missing." % (inAUDFileName)
errorFound = True
if not errorFound:
try:
print "[Info] Opening %s" % (inAUDFileName)

View file

@ -56,7 +56,7 @@ class devCommentaryText(object):
def __init__(self, traceModeEnabled = True):
self.m_traceModeEnabled = traceModeEnabled
return
def printTexts(self):
if self.m_traceModeEnabled:
print "[Trace] Printing all dev commentary text"
@ -73,18 +73,18 @@ class devCommentaryText(object):
for (idTre, textTre) in DEV_ISEZ_QUOTES_TUPLE_LIST:
print "%s\t%s" % (idTre, textTre)
return
def getAudioCommentaryTextEntriesList(self):
if self.m_traceModeEnabled:
print "[Trace] getAudioCommentaryTextEntriesList"
return DEV_AUDIO_COMMENTARY_TUPLE_LIST
def getISEZTextEntriesList(self):
if self.m_traceModeEnabled:
print "[Trace] getISEZTextEntriesList"
return DEV_ISEZ_QUOTES_TUPLE_LIST
def getExtraSpeechAudioEntriesList(self):
if self.m_traceModeEnabled:
print "[Trace] getExtraSpeechAudioEntriesList"

View file

@ -175,19 +175,19 @@ class pogoTextResource(object):
def __init__(self, traceModeEnabled = True):
self.m_traceModeEnabled = traceModeEnabled
return
def printPogo(self):
if self.m_traceModeEnabled:
print "[Trace] printing Pogo..."
for (idTre, textTre) in POGO_TEXT_RESOURCE_TUPLE_LIST:
print "%s\t%s" % (idTre, textTre)
return
def getPogoEntriesList(self):
if self.m_traceModeEnabled:
print "[Trace] getPogoEntriesList()"
return POGO_TEXT_RESOURCE_TUPLE_LIST
#
#
#
@ -201,4 +201,3 @@ else:
#debug
#print "[Debug] Running %s imported from another module" % (my_module_name)
pass

View file

@ -7,11 +7,11 @@ except ImportError:
print ("[Error] sys python library is required to be installed!")
else:
sysLibFound = True
if (not sysLibFound):
sys.stdout.write("[Error] Errors were found when trying to import required python libraries\n")
sys.exit(1)
if not (sys.version_info[0] == 2 and sys.version_info[1] == 7):
sys.stdout.write("[Error] Blade Runner Quotes Spreadsheet Creator script requires Python 2.7\n")
sys.exit(1)

View file

@ -14,19 +14,19 @@ xlwtLibFound = False
csvLibFound = False
try:
import os
import os
except ImportError:
print "[Error] os python library is required to be installed!"
print "[Error] os python library is required to be installed!"
else:
osLibFound = True
try:
import sys
import sys
except ImportError:
print "[Error] sys python library is required to be installed!"
print "[Error] sys python library is required to be installed!"
else:
sysLibFound = True
try:
import shutil
except ImportError:
@ -409,7 +409,7 @@ def inputTLKsExport(inputTLKpath, outputWAVpath, pExportWavFilesMode, pExtractDe
if not fileIsMIX: # TLK file
(actorID, actorSName, localQuoteId) = getActorShortNameAndLocalQuoteIdByAUDHashID(idOfAUDEntry)
targetSimpleWavFileName = actorSName + '_' + str(localQuoteId).zfill(4) + '_' + ''.join('{:08X}'.format(idOfAUDEntry)).upper()+'.WAV'
audFileBuffer = inTLKorMIXFile.read(sizeOfAUDEntry)
if (len(audFileBuffer) == sizeOfAUDEntry):
# load audio file (AUD) file
@ -469,7 +469,7 @@ def appendVQAPlaceHolderSheets(excelOutBook = None):
# Fill in with placeholder content
n+=1
vqaTRInstance = vqasTextResource(gTraceModeEnabled)
objUTF8Unicode = None
for m, e1 in enumerate(vqaTRInstance.getVqaEntriesList(currVQAFileNameDesc[0]), n):
sh.write(m, 0, e1[0]) # start frame
@ -502,7 +502,7 @@ def appendPOGOTextSheet(excelOutBook = None):
sh.write(n, 1, col2_name)
n+=1
pogoTRInstance = pogoTextResource(gTraceModeEnabled)
objUTF8Unicode = None
for m, e1 in enumerate(pogoTRInstance.getPogoEntriesList(), n):
sh.write(m, 0, e1[0])
@ -522,7 +522,7 @@ def auxPopulateExtraSpeechAudioRow(sh = None, n = 0, pFilenameStr = '', pTextStr
or pListOfExtraWavsForDevSheet is None \
or len(pListOfExtraWavsForDevSheet) == 0:
return False
foundMatch = False
for dcAUDFilename, dcArchiveMIXFile in SUPPORTED_EXPORTED_AUD_FROM_MIX_FILES:
if dcAUDFilename == pFilenameStr:
@ -542,7 +542,7 @@ def auxPopulateExtraSpeechAudioRow(sh = None, n = 0, pFilenameStr = '', pTextStr
if smArchiveMIXFile == dcArchiveMIXFile:
sh.write(n, 5, smArchiveMIXShort) # Resource - proper
break
for extraWavFDS in pListOfExtraWavsForDevSheet:
twoTokensOfRelDirnameAndFilenameXLS = extraWavFDS.split('&', 2)
if len(twoTokensOfRelDirnameAndFilenameXLS) == 3:
@ -565,16 +565,16 @@ def auxPopulateExtraSpeechAudioRow(sh = None, n = 0, pFilenameStr = '', pTextStr
foundMatch = True
break
return foundMatch
def appendDevCommentarySheet(excelOutBook = None, listOfExtraWavsForDevSheet = None ):
if excelOutBook != None \
and listOfExtraWavsForDevSheet != None \
and len(listOfExtraWavsForDevSheet) > 0:
objUTF8Unicode = None
print "[Info] Appending Developer Commentary sheet..."
sh = excelOutBook.add_sheet("DEV AUDIO")
devCommentaryTextInstance = devCommentaryText(gTraceModeEnabled)
#
@ -587,7 +587,7 @@ def appendDevCommentarySheet(excelOutBook = None, listOfExtraWavsForDevSheet = N
sh.write(n, colIdx, colNameIt)
colIdx+=1
n+= 1
col_names = ['Filename', 'Quote', 'By Actor', 'Notes', 'To Actor', 'Resource', 'ShortHandFileName']
colIdx = 0
for colNameIt in col_names:
@ -609,14 +609,14 @@ def appendDevCommentarySheet(excelOutBook = None, listOfExtraWavsForDevSheet = N
sh.write(n, colIdx, colNameIt)
colIdx+=1
n+= 1
col_names = ['Filename', 'Quote', 'By Actor', 'Notes', 'To Actor', 'Resource', 'ShortHandFileName']
colIdx = 0
for colNameIt in col_names:
sh.write(n, colIdx, colNameIt)
colIdx+=1
n+= 1
# populate extra speech audio rows
for pFilenameStr, pTextStr in devCommentaryTextInstance.getExtraSpeechAudioEntriesList():
if auxPopulateExtraSpeechAudioRow(sh, n, pFilenameStr, pTextStr, listOfExtraWavsForDevSheet) == True:
@ -638,8 +638,8 @@ def appendDevCommentarySheet(excelOutBook = None, listOfExtraWavsForDevSheet = N
for colNameIt in col_names:
sh.write(n, colIdx, colNameIt)
colIdx+=1
n+= 1
n+= 1
for idStr, textStr in devCommentaryTextInstance.getISEZTextEntriesList():
sh.write(n, 0, idStr)
# We assume utf-8 charset for I_SEZ Commentary (since we get the text from a python script)
@ -763,20 +763,20 @@ def inputMIXExtractTREs(inputMIXpath, excelOutBook = None):
sh.write(n, 0, col1_name)
sh.write(n, 1, col2_name)
n+=1
for m, e1 in enumerate(thisTreFile.stringEntriesLst, n):
sh.write(m, 0, e1[0])
objStr = e1[1]
if ( currTreFileName[:-1] == 'ERRORMSG.TR'):
# ERRORMSG.TRx uses different font than the others
# ERRORMSG.TRx uses different font than the others
# and there are conflicts (with the other in-game fonts)
# Supposedly these messages would be printed by an OS font
# They seem to mostly use the Latin-1 codepage, although there are a few
# They seem to mostly use the Latin-1 codepage, although there are a few
# characters that don't encode right (but they do with a IBM437 like the rest of the TRx
# Probably, these are forgotten (buggy) characters from a previous plan (print error messages with in-game font?)
# So we treat them as bugs and fix them.
# So we treat them as bugs and fix them.
# Further proof that they are buggy, there are language versions that have two codes for the same character
# in ERRORMSG TRx.
# in ERRORMSG TRx.
# Eg. in Spanish version they use \xa2 (correct with IBM437) and \xf3 (correct with Latin-1) for the 'ó' character
# or in French version 'è' uses both \x8a and \xe8
objEncodeSafeStr = ""
@ -834,7 +834,7 @@ def inputMIXExtractTREs(inputMIXpath, excelOutBook = None):
#
# Creating the OUTPUT XLS file with one sheet named as the @param sheet with entries based on the
# Creating the OUTPUT XLS file with one sheet named as the @param sheet with entries based on the
# listTlkWavs (wav files from TLK files, without duplicates)
# and /or
# listDevsWavs (extra (supported) wav files practicaclly from the SFX.MIX file), without duplicates)
@ -888,7 +888,7 @@ def outputXLS(filename, sheet, listTlkWavs, listDevsWavs, parseTREResourcesAlso
#z_desc = 'Test'
#desc = [x_desc, y_desc, z_desc]
#
#
#
# You may need to group the variables together
#for n, (v_desc, v) in enumerate(zip(desc, variables)):
#sh.write(n, 0, v_desc)
@ -989,13 +989,13 @@ def outputXLS(filename, sheet, listTlkWavs, listDevsWavs, parseTREResourcesAlso
print "[Error] Could not save the output Excel file:: " + str(e)
#
# Aux function to weed out duplicates from wav file lists
# Aux function to weed out duplicates from wav file lists
# valid listTypes: 'TLKWAVS', 'EXTRAMIXWAVS'
def wavDupsRemove(listOfWavFiles, listType):
if listType != 'TLKWAVS' and listType != 'EXTRAMIXWAVS':
print '[Error] Invalid listtype %s specified to remove duplicate wav files' % (listType)
sys.exit(1)
listOfWavFilesNoDups = []
for filenameSrcTmp in listOfWavFiles:
duplicateFound = False
@ -1005,20 +1005,20 @@ def wavDupsRemove(listOfWavFiles, listType):
tmpRelDirNameSrc = twoTokensOfRelDirnameAndFilenameSrc[1] # eg. TLK1
keyForDuplicateSearchSrc = None
keyForDuplicateSearchTarg = None
if (listType == 'EXTRAMIXWAVS'):
keyForDuplicateSearchSrc = twoTokensOfRelDirnameAndFilenameSrc[0]
keyForDuplicateSearchSrc = twoTokensOfRelDirnameAndFilenameSrc[0]
else:
threeTokensOfQuoteFilenameSrc = twoTokensOfRelDirnameAndFilenameSrc[0].split('#', 2)
#concatenate actorID and quoteID for search key
keyForDuplicateSearchSrc = threeTokensOfQuoteFilenameSrc[0] + threeTokensOfQuoteFilenameSrc[1]
for fileTargIdx, filenameTargTmp in enumerate(listOfWavFilesNoDups):
twoTokensOfRelDirnameAndFilenameTarg = filenameTargTmp.split('&', 2)
tmpRelDirNameTarg = twoTokensOfRelDirnameAndFilenameTarg[1]
if (listType == 'EXTRAMIXWAVS'):
keyForDuplicateSearchTarg = twoTokensOfRelDirnameAndFilenameTarg[0]
keyForDuplicateSearchTarg = twoTokensOfRelDirnameAndFilenameTarg[0]
else:
threeTokensOfQuoteFilenameTarg = twoTokensOfRelDirnameAndFilenameTarg[0].split('#', 2)
#concatenate actorID and quoteID for search key
@ -1068,7 +1068,7 @@ def main(argsCL):
global gMIXWavFilesNoDups
global gTLKWavFiles
global gTLKWavFilesNoDups
gTraceModeEnabled = False
gActiveLanguageDescriptionCodeTuple = DEFAULT_LANG_DESC_CODE
@ -1221,8 +1221,8 @@ def main(argsCL):
if (len(nameTmp) > 4) \
and nameTmp.upper()[-4:] == '.WAV' \
and len(nameTmp.split('.', 1)) == 2: # radical heal (but practical) - don't allow cases like .AUD.WAV or any intermediate dots in the filename!
relDirName = ''
# os.path.split would Split the pathname path into a pair,
relDirName = ''
# os.path.split would Split the pathname path into a pair,
# (head, tail) where tail is the last pathname component and head is everything leading up to that. The tail part will never contain a slash
pathTokens = dirpath.split(os.path.sep)
idxOfLastTLKToken = -1
@ -1230,12 +1230,12 @@ def main(argsCL):
for tokenIdx, pTokenTmp in enumerate(pathTokens):
posOfTLKWithinRightmostToken = pTokenTmp.find("TLK")
posOfSFXWithinRightmostToken = pTokenTmp.find("SFX")
if posOfTLKWithinRightmostToken != -1:
idxOfLastTLKToken = tokenIdx
if posOfSFXWithinRightmostToken != -1:
idxOfLastSFXToken = tokenIdx
if (posOfTLKWithinRightmostToken != -1 \
or posOfSFXWithinRightmostToken != -1):
relDirName = pTokenTmp # don't break, we are interested in right-most matching token in the path
@ -1246,7 +1246,7 @@ def main(argsCL):
if (idxOfLastSFXToken > idxOfLastTLKToken \
and (nameTmp.upper()[:-4] + '.AUD') in zip(*SUPPORTED_EXPORTED_AUD_FROM_MIX_FILES)[0]):
gMIXWavFiles.append(filenames[nameIdx] +'&' + relDirName + '&' + os.path.join(dirpath, nameTmp))
else:
else:
gTLKWavFiles.append(filenames[nameIdx] +'&' + relDirName + '&' + os.path.join(dirpath, nameTmp))
#break
for fileIdx, filenameTmp in enumerate(gTLKWavFiles):
@ -1294,10 +1294,10 @@ def main(argsCL):
else:
print "[Error] in splitting tokens on _: %s" % (filenameTmp)
sys.exit(0)
#
#
# Now handle the extra speech files (-xdevs mode)
for fileIdx, filenameTmp in enumerate(gMIXWavFiles): #
# if it's a AUD file from a MIX archive, we treat it differently here
for fileIdx, filenameTmp in enumerate(gMIXWavFiles): #
# if it's a AUD file from a MIX archive, we treat it differently here
# (we will put it in another sheet)
twoTokensOfFilenameAndRelDirname = filenameTmp.split('&', 1)
if len(twoTokensOfFilenameAndRelDirname) != 2:
@ -1314,7 +1314,7 @@ def main(argsCL):
gMIXWavFiles.sort()
#
#
# Remove duplicates from TLK AUD speech files (-xwav mode)
# Remove duplicates from TLK AUD speech files (-xwav mode)
#
gTLKWavFilesNoDups = wavDupsRemove(gTLKWavFiles, 'TLKWAVS')
if len(gTLKWavFilesNoDups) == 0:
@ -1327,7 +1327,7 @@ def main(argsCL):
if extractDevCommAndExtraSFXMode and len(gMIXWavFilesNoDups) == 0:
print "[Error] No supported extra speech audio files (WAV) were found in the output folder path (-op switch)."
sys.exit(1)
constructedOutputFilename = "%s-%s%s" % (OUTPUT_XLS_FILENAME, gActiveLanguageDescriptionCodeTuple[2], OUTPUT_XLS_FILENAME_EXT)
print "[Info] Creating output excel %s file..." % (constructedOutputFilename)
outputXLS(constructedOutputFilename, OUTPUT_XLS_QUOTES_SHEET + gActiveLanguageDescriptionCodeTuple[1] + '.TR' + gActiveLanguageDescriptionCodeTuple[1], gTLKWavFilesNoDups, gMIXWavFilesNoDups, extractTreFilesMode, extractDevCommAndExtraSFXMode, extractPOGOTextMode, TMProotFolderWithInputTLKFiles)

View file

@ -12,7 +12,7 @@ except ImportError:
print "[Error] os python library is required to be installed!"
else:
osLibFound = True
try:
import sys
except ImportError:
@ -32,7 +32,7 @@ if (not osLibFound) \
or (not structLibFound):
sys.stdout.write("[Error] Errors were found when trying to import required python libraries\n")
sys.exit(1)
from struct import *
MY_MODULE_VERSION = "0.50"
@ -51,7 +51,7 @@ class treFile(object):
stringEntriesLst = [] # list of two-value tuples. First value is ID, second value is String content
stringOffsets = []
m_traceModeEnabled = False
# traceModeEnabled is bool to enable more printed debug messages
def __init__(self, traceModeEnabled = True):
del self.stringEntriesLst[:]
@ -59,7 +59,7 @@ class treFile(object):
self.simpleTextResourceFileName = 'GENERIC.TRE'
self.m_traceModeEnabled = traceModeEnabled
return
def loadTreFile(self, treBytesBuff, maxLength, treFileName):
self.simpleTextResourceFileName = treFileName
offsInTreFile = 0
@ -79,7 +79,7 @@ class treFile(object):
tmpTuple = struct.unpack_from('I', treBytesBuff, offsInTreFile) # unsigned integer 4 bytes
self.stringEntriesLst.append( (tmpTuple[0], '') )
offsInTreFile += 4
# string offsets table (each entry is unsigned integer 4 bytes)
for idx in range(0, self.header().numOfTextResources):
tmpTuple = struct.unpack_from('I', treBytesBuff, offsInTreFile) # unsigned integer 4 bytes
@ -91,9 +91,9 @@ class treFile(object):
absStartOfIndexTable = 4
#absStartOfOffsetTable = absStartOfIndexTable + (self.header().numOfTextResources * 4)
#absStartOfStringTable = absStartOfOffsetTable + ((self.header().numOfTextResources+1) * 4)
#print "[Debug] buffer type: " , type(treBytesBuff) # it is str
for idx in range(0, self.header().numOfTextResources):
currOffset = self.stringOffsets[idx] + absStartOfIndexTable
# the buffer (treBytesBuff) where we read the TRE file into, is "str" type but contains multiple null terminated strings
@ -114,7 +114,7 @@ class treFile(object):
except:
print "[Error] Loading Text Resource %s failed!" % (self.simpleTextResourceFileName)
return False
def header(self):
return self.m_header
#
@ -127,7 +127,7 @@ if __name__ == '__main__':
# otherwise tries to use the first command line argument as input file
inTREFile = None
inTREFileName = 'ACTORS.TRE'
if len(sys.argv[1:]) > 0 \
and os.path.isfile(os.path.join('.', sys.argv[1])) \
and len(sys.argv[1]) >= 5 \
@ -139,7 +139,7 @@ if __name__ == '__main__':
else:
print "[Error] No valid input file argument was specified and default input file %s is missing." % (inTREFileName)
errorFound = True
if not errorFound:
try:
print "[Info] Opening %s" % (inTREFileName)

View file

@ -12,7 +12,7 @@ def merge_ranges(*ranges):
def processtable(inputfilename, outfile, highrange, lowrange):
with open(inputfilename) as f:
res = dict(((x << 8) | y, 0) for x in highrange for y in lowrange)
res = dict(((x << 8) | y, 0) for x in highrange for y in lowrange)
for line in f:
if line.startswith('#'):

View file

@ -150,7 +150,7 @@ private:
const byte *_ptr;
public:
MemoryReadStream(const byte *ptr) : _ptr(ptr) {}
byte readByte() {
return *_ptr++;
}

View file

@ -1,5 +1,5 @@
This tool creates hugo.dat.
This file contains all the hardcoded strings, logic, fonts, and bitmaps and
This tool creates hugo.dat.
This file contains all the hardcoded strings, logic, fonts, and bitmaps and
is used by the engine depending on the version of the game started.
In order to work properly, the content of the DATA sub-directory has to be

View file

@ -121,7 +121,7 @@ std::string MSVCProvider::getLibraryFromFeature(const char *feature, const Build
libs += basename;
}
}
return libs;
}

View file

@ -38,8 +38,8 @@ protected:
StringList _disableEditAndContinue;
std::list<MSVC_Architecture> _archs;
std::map<MSVC_Architecture, StringList> _arch_disabled_features;
std::map<MSVC_Architecture, StringList> _arch_disabled_features;
/**
* MSVC properties for a library required by a feature
*/

View file

@ -31,7 +31,7 @@
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'================================================================
' TODO: Reduce duplication with revision.vbs script
' TODO: Reduce duplication with revision.vbs script
' (ReadRegistryKey and ParseCommandLine are identical)
'================================================================

View file

@ -99,9 +99,9 @@ Sub DetermineRevision()
End If
End If
End If
Dim outputInfo : outputInfo = "Found revision " & revision & " on branch " & branch
' Setup our revision string
Dim revisionString : revisionString = revision
@ -120,7 +120,7 @@ Sub DetermineRevision()
revisionString = revisionString & "-" & tool
outputInfo = outputInfo & " using " & tool
End If
Wscript.StdErr.WriteLine outputInfo & vbCrLf
OutputRevisionHeader revisionString

Some files were not shown because too many files have changed in this diff Show more