Code formatting fixes

svn-id: r28945
This commit is contained in:
Max Horn 2007-09-18 20:16:33 +00:00
parent c3d3aebe87
commit 3abc11611e
76 changed files with 602 additions and 602 deletions

View file

@ -111,11 +111,11 @@ RoninCDFilesystemNode::RoninCDFilesystemNode(const String &p, bool verify) {
if (verify) {
int fd;
if((fd = open(_path.c_str(), O_RDONLY)) >= 0) {
if ((fd = open(_path.c_str(), O_RDONLY)) >= 0) {
close(fd);
_isDirectory = false;
}
else if((fd = open(_path.c_str(), O_DIR|O_RDONLY)) >= 0) {
else if ((fd = open(_path.c_str(), O_DIR|O_RDONLY)) >= 0) {
close(fd);
}
else {

View file

@ -241,7 +241,7 @@ bool GP32FilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, bool
}
AbstractFilesystemNode *GP32FilesystemNode::getParent() const {
if(_isRoot)
if (_isRoot)
return 0;
const char *start = _path.c_str();

View file

@ -197,7 +197,7 @@ bool PalmOSFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, bo
if (error)
return false;
while(dirIterator != expIteratorStop) {
while (dirIterator != expIteratorStop) {
error = VFSDirEntryEnumerate(handle, &dirIterator, &desc);
if (!error) {
addFile(myList, mode, _path.c_str(), &desc);

View file

@ -178,7 +178,7 @@ bool POSIXFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, boo
continue;
}
// Skip '.' and '..' to avoid cycles
if((dp->d_name[0] == '.' && dp->d_name[1] == 0) || (dp->d_name[0] == '.' && dp->d_name[1] == '.')) {
if ((dp->d_name[0] == '.' && dp->d_name[1] == 0) || (dp->d_name[0] == '.' && dp->d_name[1] == '.')) {
continue;
}

View file

@ -157,7 +157,7 @@ AbstractFilesystemNode *SymbianFilesystemNode::getChild(const String &n) const {
fname.Copy(ptr);
TBool isFolder = EFalse;
BaflUtils::IsFolder(CEikonEnv::Static()->FsSession(), fname, isFolder);
if(!isFolder)
if (!isFolder)
return 0;
return new SymbianFilesystemNode(newPath);
@ -182,12 +182,12 @@ bool SymbianFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b
TInt err = fs.Volume(volumeInfo, driveNumber);
if (err != KErrNone)
continue;
if(fs.DriveToChar(driveNumber,driveLetter) != KErrNone)
if (fs.DriveToChar(driveNumber,driveLetter) != KErrNone)
continue;
driveLetterValue = driveLetter;
if(volumeInfo.iName.Length() > 0) {
if (volumeInfo.iName.Length() > 0) {
driveLabel8.Copy(volumeInfo.iName); // 16 to 8bit des // enabling this line alone gives KERN-EXEC 3 with non-optimized GCC? WHY? grrr
driveString8.Format(_L8("Drive %c: (%S)"), driveLetterValue, &driveLabel8);
} else {
@ -211,10 +211,10 @@ bool SymbianFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b
fname.Copy(ptr);
TBuf8<256>nameBuf;
CDir* dirPtr;
if(CEikonEnv::Static()->FsSession().GetDir(fname,KEntryAttNormal|KEntryAttDir,0,dirPtr)==KErrNone) {
if (CEikonEnv::Static()->FsSession().GetDir(fname,KEntryAttNormal|KEntryAttDir,0,dirPtr)==KErrNone) {
CleanupStack::PushL(dirPtr);
TInt cnt=dirPtr->Count();
for(TInt loop=0;loop<cnt;loop++) {
for (TInt loop=0;loop<cnt;loop++) {
TEntry fileentry=(*dirPtr)[loop];
nameBuf.Copy(fileentry.iName);
SymbianFilesystemNode entry(false);

View file

@ -16,7 +16,7 @@ Char **ArgsInit() {
// initial position
argvP++;
for(UInt8 count = 0; count < MAX_ARG; count++)
for (UInt8 count = 0; count < MAX_ARG; count++)
argvP[count] = NULL;
return argvP;
@ -49,7 +49,7 @@ void ArgsFree(Char **argvP) {
MemHandle oldH;
for(UInt8 count = 0; count < MAX_ARG; count++)
for (UInt8 count = 0; count < MAX_ARG; count++)
if (argvP[count]) {
oldH = MemPtrRecoverHandle(argvP[count]);
MemHandleUnlock(oldH);
@ -68,7 +68,7 @@ void ArgsSetOwner(Char **argvP, UInt16 owner) {
MemHandle oldH;
for(UInt8 count = 0; count < MAX_ARG; count++)
for (UInt8 count = 0; count < MAX_ARG; count++)
if (argvP[count]) {
oldH = MemPtrRecoverHandle(argvP[count]);
MemHandleSetOwner(oldH, owner);
@ -81,7 +81,7 @@ void ArgsSetOwner(Char **argvP, UInt16 owner) {
void ArgsExportInit(Char **argvP, UInt32 countArg, Boolean arm) {
if (arm) {
for(UInt8 count = 0; count < MAX_ARG; count++)
for (UInt8 count = 0; count < MAX_ARG; count++)
if (argvP[count])
argvP[count] = (Char *)ByteSwap32(argvP[count]);
}
@ -96,7 +96,7 @@ void ArgsExportRelease(Boolean arm) {
Err e = FtrGet(appFileCreator, ftrArgsData, (UInt32 *)&argvP);
if (argvP)
for(UInt8 count = 0; count < MAX_ARG; count++)
for (UInt8 count = 0; count < MAX_ARG; count++)
if (argvP[count])
argvP[count] = (Char *)ByteSwap32(argvP[count]);
}

View file

@ -92,7 +92,7 @@ bool OSystem_PalmBase::pollEvent(Common::Event &event) {
timer_handler();
sound_handler();
for(;;) {
for (;;) {
// check for hardkey repeat for mouse emulation
keyCurrentState = KeyCurrentState();

View file

@ -95,7 +95,7 @@ void OSystem_PalmBase::initSize(uint w, uint h) {
void OSystem_PalmBase::setPalette(const byte *colors, uint start, uint num) {
RGBColorType *base = _currentPalette + start;
for(uint i = 0; i < num; i++) {
for (uint i = 0; i < num; i++) {
base[i].r = colors[0];
base[i].g = colors[1];
base[i].b = colors[2];

View file

@ -52,8 +52,8 @@ void DrawStatus(Boolean show) {
if (depth == 8) {
UInt8 *src = (UInt8 *)BmpGetBits(WinGetBitmap(WinGetDisplayWindow()));
src += gVars->screenPitch + 1;
for(y=0; y < 4; y++) {
for(x=0; x < 4; x++)
for (y=0; y < 4; y++) {
for (x=0; x < 4; x++)
src[x] = color;
src += gVars->screenPitch;
@ -62,8 +62,8 @@ void DrawStatus(Boolean show) {
} else if (depth == 16) {
Int16 *src = (Int16 *)BmpGetBits(WinGetBitmap(WinGetDisplayWindow()));
src += gVars->screenPitch + 1;
for(y=0; y < 4; y++) {
for(x=0; x < 4; x++)
for (y=0; y < 4; y++) {
for (x=0; x < 4; x++)
src[x] = color;
src += gVars->screenPitch;

View file

@ -46,7 +46,7 @@ UInt16 SilkInit(UInt32 *retVersion) {
if (e) {
// v1 = NR
e = SilkLibOpen(slkRefNum);
if(!e) version = vskVersionNum1;
if (!e) version = vskVersionNum1;
} else {
// v2 = NX/NZ

View file

@ -26,7 +26,7 @@
#include "be_os5.h"
void OSystem_PalmOS5::setCursorPalette(const byte *colors, uint start, uint num) {
for(uint i = 0; i < num; i++) {
for (uint i = 0; i < num; i++) {
_mousePal[i + start] = gfxMakeDisplayRGB(colors[0], colors[1], colors[2]);
colors += 4;
}

View file

@ -108,6 +108,6 @@ void pcm2adpcm(Int16 *src, UInt8 *dst, UInt32 length) {
*dst++ = (UInt8)data;
} while(--length);
} while (--length);
}

View file

@ -44,28 +44,28 @@ void OSystem_Dreamcast::checkSound()
int n;
int curr_ring_buffer_samples;
if(!_mixer)
if (!_mixer)
return;
if(read_sound_int(&SOUNDSTATUS->mode) != MODE_PLAY)
if (read_sound_int(&SOUNDSTATUS->mode) != MODE_PLAY)
start_sound();
curr_ring_buffer_samples = read_sound_int(&SOUNDSTATUS->ring_length);
n = read_sound_int(&SOUNDSTATUS->samplepos);
if((n-=fillpos)<0)
if ((n-=fillpos)<0)
n += curr_ring_buffer_samples;
n = ADJUST_BUFFER_SIZE(n-10);
if(n<100)
if (n<100)
return;
Audio::Mixer::mixCallback(_mixer, (byte*)temp_sound_buffer,
2*SAMPLES_TO_BYTES(n));
if(fillpos+n > curr_ring_buffer_samples) {
if (fillpos+n > curr_ring_buffer_samples) {
int r = curr_ring_buffer_samples - fillpos;
memcpy4s(RING_BUF+fillpos, temp_sound_buffer, SAMPLES_TO_BYTES(r));
fillpos = 0;
@ -74,7 +74,7 @@ void OSystem_Dreamcast::checkSound()
} else {
memcpy4s(RING_BUF+fillpos, temp_sound_buffer, SAMPLES_TO_BYTES(n));
}
if((fillpos += n) >= curr_ring_buffer_samples)
if ((fillpos += n) >= curr_ring_buffer_samples)
fillpos = 0;
}

View file

@ -116,14 +116,14 @@ extern "C" void flush_instruction_cache();
static void purge_copyback()
{
int i;
for(i=0; i!=(1<<14); i+=(1<<5))
for (i=0; i!=(1<<14); i+=(1<<5))
*(volatile unsigned int *)(0xf4000000+i) &= ~3;
}
void DLObject::seterror(const char *fmt, ...)
{
if(errbuf) {
if (errbuf) {
va_list va;
va_start(va, fmt);
vsnprintf(errbuf, MAXDLERRLEN, fmt, va);
@ -151,12 +151,12 @@ bool DLObject::relocate(int fd, unsigned long offset, unsigned long size)
{
Elf32_Rela *rela;
if(!(rela = (Elf32_Rela *)malloc(size))) {
if (!(rela = (Elf32_Rela *)malloc(size))) {
seterror("Out of memory.");
return false;
}
if(lseek(fd, offset, SEEK_SET)<0 ||
if (lseek(fd, offset, SEEK_SET)<0 ||
read(fd, rela, size) != size) {
seterror("Relocation table load failed.");
free(rela);
@ -164,7 +164,7 @@ bool DLObject::relocate(int fd, unsigned long offset, unsigned long size)
}
int cnt = size / sizeof(*rela);
for(int i=0; i<cnt; i++) {
for (int i=0; i<cnt; i++) {
Elf32_Sym *sym = (Elf32_Sym *)(((char *)symtab)+(rela[i].r_info>>4));
@ -172,7 +172,7 @@ bool DLObject::relocate(int fd, unsigned long offset, unsigned long size)
switch(rela[i].r_info & 0xf) {
case 1: /* DIR32 */
if(sym->st_shndx < 0xff00)
if (sym->st_shndx < 0xff00)
*(unsigned long *)target += (unsigned long)segment;
break;
default:
@ -195,7 +195,7 @@ bool DLObject::load(int fd)
Elf32_Shdr *shdr;
int symtab_sect = -1;
if(read(fd, &ehdr, sizeof(ehdr)) != sizeof(ehdr) ||
if (read(fd, &ehdr, sizeof(ehdr)) != sizeof(ehdr) ||
memcmp(ehdr.e_ident, ELFMAG, SELFMAG) ||
ehdr.e_type != 2 || ehdr.e_machine != 42 ||
ehdr.e_phentsize < sizeof(phdr) || ehdr.e_shentsize != sizeof(*shdr) ||
@ -207,13 +207,13 @@ bool DLObject::load(int fd)
DBG("phoff = %d, phentsz = %d, phnum = %d\n",
ehdr.e_phoff, ehdr.e_phentsize, ehdr.e_phnum);
if(lseek(fd, ehdr.e_phoff, SEEK_SET)<0 ||
if (lseek(fd, ehdr.e_phoff, SEEK_SET)<0 ||
read(fd, &phdr, sizeof(phdr)) != sizeof(phdr)) {
seterror("Program header load failed.");
return false;
}
if(phdr.p_type != 1 || phdr.p_vaddr != 0 || phdr.p_paddr != 0 ||
if (phdr.p_type != 1 || phdr.p_vaddr != 0 || phdr.p_paddr != 0 ||
phdr.p_filesz > phdr.p_memsz) {
seterror("Invalid program header.");
return false;
@ -222,17 +222,17 @@ bool DLObject::load(int fd)
DBG("offs = %d, filesz = %d, memsz = %d, align = %d\n",
phdr.p_offset, phdr.p_filesz, phdr.p_memsz, phdr.p_align);
if(!(segment = memalign(phdr.p_align, phdr.p_memsz))) {
if (!(segment = memalign(phdr.p_align, phdr.p_memsz))) {
seterror("Out of memory.");
return false;
}
DBG("segment @ %p\n", segment);
if(phdr.p_memsz > phdr.p_filesz)
if (phdr.p_memsz > phdr.p_filesz)
memset(((char *)segment) + phdr.p_filesz, 0, phdr.p_memsz - phdr.p_filesz);
if(lseek(fd, phdr.p_offset, SEEK_SET)<0 ||
if (lseek(fd, phdr.p_offset, SEEK_SET)<0 ||
read(fd, segment, phdr.p_filesz) != phdr.p_filesz) {
seterror("Segment load failed.");
return false;
@ -241,12 +241,12 @@ bool DLObject::load(int fd)
DBG("shoff = %d, shentsz = %d, shnum = %d\n",
ehdr.e_shoff, ehdr.e_shentsize, ehdr.e_shnum);
if(!(shdr = (Elf32_Shdr *)malloc(ehdr.e_shnum * sizeof(*shdr)))) {
if (!(shdr = (Elf32_Shdr *)malloc(ehdr.e_shnum * sizeof(*shdr)))) {
seterror("Out of memory.");
return false;
}
if(lseek(fd, ehdr.e_shoff, SEEK_SET)<0 ||
if (lseek(fd, ehdr.e_shoff, SEEK_SET)<0 ||
read(fd, shdr, ehdr.e_shnum * sizeof(*shdr)) !=
ehdr.e_shnum * sizeof(*shdr)) {
seterror("Section headers load failed.");
@ -254,41 +254,41 @@ bool DLObject::load(int fd)
return false;
}
for(int i=0; i<ehdr.e_shnum; i++) {
for (int i=0; i<ehdr.e_shnum; i++) {
DBG("Section %d: type = %d, size = %d, entsize = %d, link = %d\n",
i, shdr[i].sh_type, shdr[i].sh_size, shdr[i].sh_entsize, shdr[i].sh_link);
if(shdr[i].sh_type == 2 && shdr[i].sh_entsize == sizeof(Elf32_Sym) &&
if (shdr[i].sh_type == 2 && shdr[i].sh_entsize == sizeof(Elf32_Sym) &&
shdr[i].sh_link < ehdr.e_shnum && shdr[shdr[i].sh_link].sh_type == 3 &&
symtab_sect < 0)
symtab_sect = i;
}
if(symtab_sect < 0) {
if (symtab_sect < 0) {
seterror("No symbol table.");
free(shdr);
return false;
}
if(!(symtab = malloc(shdr[symtab_sect].sh_size))) {
if (!(symtab = malloc(shdr[symtab_sect].sh_size))) {
seterror("Out of memory.");
free(shdr);
return false;
}
if(lseek(fd, shdr[symtab_sect].sh_offset, SEEK_SET)<0 ||
if (lseek(fd, shdr[symtab_sect].sh_offset, SEEK_SET)<0 ||
read(fd, symtab, shdr[symtab_sect].sh_size) != shdr[symtab_sect].sh_size){
seterror("Symbol table load failed.");
free(shdr);
return false;
}
if(!(strtab = (char *)malloc(shdr[shdr[symtab_sect].sh_link].sh_size))) {
if (!(strtab = (char *)malloc(shdr[shdr[symtab_sect].sh_link].sh_size))) {
seterror("Out of memory.");
free(shdr);
return false;
}
if(lseek(fd, shdr[shdr[symtab_sect].sh_link].sh_offset, SEEK_SET)<0 ||
if (lseek(fd, shdr[shdr[symtab_sect].sh_link].sh_offset, SEEK_SET)<0 ||
read(fd, strtab, shdr[shdr[symtab_sect].sh_link].sh_size) !=
shdr[shdr[symtab_sect].sh_link].sh_size){
seterror("Symbol table strings load failed.");
@ -300,15 +300,15 @@ bool DLObject::load(int fd)
DBG("Loaded %d symbols.\n", symbol_cnt);
Elf32_Sym *s = (Elf32_Sym *)symtab;
for(int c = symbol_cnt; c--; s++)
if(s->st_shndx < 0xff00)
for (int c = symbol_cnt; c--; s++)
if (s->st_shndx < 0xff00)
s->st_value += (Elf32_Addr)segment;
for(int i=0; i<ehdr.e_shnum; i++)
if(shdr[i].sh_type == 4 && shdr[i].sh_entsize == sizeof(Elf32_Rela) &&
for (int i=0; i<ehdr.e_shnum; i++)
if (shdr[i].sh_type == 4 && shdr[i].sh_entsize == sizeof(Elf32_Rela) &&
shdr[i].sh_link == symtab_sect && shdr[i].sh_info < ehdr.e_shnum &&
(shdr[shdr[i].sh_info].sh_flags & 2))
if(!relocate(fd, shdr[i].sh_offset, shdr[i].sh_size)) {
if (!relocate(fd, shdr[i].sh_offset, shdr[i].sh_size)) {
free(shdr);
return false;
}
@ -325,12 +325,12 @@ bool DLObject::open(const char *path)
DBG("open(\"%s\")\n", path);
if((fd = ::open(path, O_RDONLY))<0) {
if ((fd = ::open(path, O_RDONLY))<0) {
seterror("%s not found.", path);
return false;
}
if(!load(fd)) {
if (!load(fd)) {
::close(fd);
unload();
return false;
@ -349,7 +349,7 @@ bool DLObject::open(const char *path)
dtors_start = symbol("__plugin_dtors");
dtors_end = symbol("__plugin_dtors_end");
if(ctors_start == NULL || ctors_end == NULL || dtors_start == NULL ||
if (ctors_start == NULL || ctors_end == NULL || dtors_start == NULL ||
dtors_end == NULL) {
seterror("Missing ctors/dtors.");
dtors_start = dtors_end = NULL;
@ -358,7 +358,7 @@ bool DLObject::open(const char *path)
}
DBG("Calling constructors.\n");
for(void (**f)(void) = (void (**)(void))ctors_start; f != ctors_end; f++)
for (void (**f)(void) = (void (**)(void))ctors_start; f != ctors_end; f++)
(**f)();
DBG("%s opened ok.\n", path);
@ -367,8 +367,8 @@ bool DLObject::open(const char *path)
bool DLObject::close()
{
if(dtors_start != NULL && dtors_end != NULL)
for(void (**f)(void) = (void (**)(void))dtors_start; f != dtors_end; f++)
if (dtors_start != NULL && dtors_end != NULL)
for (void (**f)(void) = (void (**)(void))dtors_start; f != dtors_end; f++)
(**f)();
dtors_start = dtors_end = NULL;
unload();
@ -379,14 +379,14 @@ void *DLObject::symbol(const char *name)
{
DBG("symbol(\"%s\")\n", name);
if(symtab == NULL || strtab == NULL || symbol_cnt < 1) {
if (symtab == NULL || strtab == NULL || symbol_cnt < 1) {
seterror("No symbol table loaded.");
return NULL;
}
Elf32_Sym *s = (Elf32_Sym *)symtab;
for(int c = symbol_cnt; c--; s++)
if((s->st_info>>4 == 1 || s->st_info>>4 == 2) &&
for (int c = symbol_cnt; c--; s++)
if ((s->st_info>>4 == 1 || s->st_info>>4 == 2) &&
strtab[s->st_name] == '_' && !strcmp(name, strtab+s->st_name+1)) {
DBG("=> %p\n", (void*)s->st_value);
return (void*)s->st_value;
@ -402,7 +402,7 @@ static char dlerr[MAXDLERRLEN];
void *dlopen(const char *filename, int flags)
{
DLObject *obj = new DLObject(dlerr);
if(obj->open(filename))
if (obj->open(filename))
return (void *)obj;
delete obj;
return NULL;
@ -411,11 +411,11 @@ void *dlopen(const char *filename, int flags)
int dlclose(void *handle)
{
DLObject *obj = (DLObject *)handle;
if(obj == NULL) {
if (obj == NULL) {
strcpy(dlerr, "Handle is NULL.");
return -1;
}
if(obj->close()) {
if (obj->close()) {
delete obj;
return 0;
}
@ -424,7 +424,7 @@ int dlclose(void *handle)
void *dlsym(void *handle, const char *symbol)
{
if(handle == NULL) {
if (handle == NULL) {
strcpy(dlerr, "Handle is NULL.");
return NULL;
}
@ -438,6 +438,6 @@ const char *dlerror()
void dlforgetsyms(void *handle)
{
if(handle != NULL)
if (handle != NULL)
((DLObject *)handle)->discard_symtab();
}

View file

@ -64,16 +64,16 @@ void OSystem_Dreamcast::initBackend()
static bool find_track(int track, int &first_sec, int &last_sec)
{
struct TOC *toc = cdfs_gettoc();
if(!toc)
if (!toc)
return false;
int i, first, last;
first = TOC_TRACK(toc->first);
last = TOC_TRACK(toc->last);
if(first < 1 || last > 99 || first > last)
if (first < 1 || last > 99 || first > last)
return false;
for(i=first; i<=last; i++)
if(!(TOC_CTRL(toc->entry[i-1])&4))
if(track==1) {
for (i=first; i<=last; i++)
if (!(TOC_CTRL(toc->entry[i-1])&4))
if (track==1) {
first_sec = TOC_LBA(toc->entry[i-1]);
last_sec = TOC_LBA(toc->entry[i]);
return true;
@ -86,14 +86,14 @@ void OSystem_Dreamcast::playCD(int track, int num_loops, int start_frame, int du
{
int first_sec, last_sec;
#if 1
if(num_loops)
if (num_loops)
--num_loops;
#endif
if(num_loops>14) num_loops=14;
else if(num_loops<0) num_loops=15; // infinity
if(!find_track(track, first_sec, last_sec))
if (num_loops>14) num_loops=14;
else if (num_loops<0) num_loops=15; // infinity
if (!find_track(track, first_sec, last_sec))
return;
if(duration)
if (duration)
last_sec = first_sec + start_frame + duration;
first_sec += start_frame;
play_cdda_sectors(first_sec, last_sec, num_loops);
@ -168,7 +168,7 @@ void OSystem_Dreamcast::setFeatureState(Feature f, bool enable)
switch(f) {
case kFeatureAspectRatioCorrection:
_aspect_stretch = enable;
if(screen)
if (screen)
setScaling();
break;
case kFeatureVirtualKeyboard:
@ -230,12 +230,12 @@ int DCLauncherDialog::runModal()
{
char *base = NULL, *dir = NULL;
if(!selectGame(base, dir, icon))
if (!selectGame(base, dir, icon))
exit(0);
// Set the game path.
ConfMan.addGameDomain(base);
if(dir != NULL)
if (dir != NULL)
ConfMan.set("path", dir, base);
// Set the target.

View file

@ -49,7 +49,7 @@
#define COPYPIXEL(n) do { \
unsigned short _tmp = pal[*s++]; \
d[n] = _tmp|(pal[*s++]<<16); \
} while(0)
} while (0)
static void texture_memcpy64_pal(void *dest, void *src, int cnt, unsigned short *pal)
{
@ -58,7 +58,7 @@ static void texture_memcpy64_pal(void *dest, void *src, int cnt, unsigned short
(0xe0000000 | (((unsigned long)dest) & 0x03ffffc0));
QACR0 = ((0xa4000000>>26)<<2)&0x1c;
QACR1 = ((0xa4000000>>26)<<2)&0x1c;
while(cnt--) {
while (cnt--) {
COPYPIXEL(0);
COPYPIXEL(1);
COPYPIXEL(2);
@ -91,7 +91,7 @@ static void texture_memcpy64(void *dest, void *src, int cnt)
(0xe0000000 | (((unsigned long)dest) & 0x03ffffc0));
QACR0 = ((0xa4000000>>26)<<2)&0x1c;
QACR1 = ((0xa4000000>>26)<<2)&0x1c;
while(cnt--) {
while (cnt--) {
d[0] = *s++;
d[1] = *s++;
d[2] = *s++;
@ -137,8 +137,8 @@ void commit_dummy_transpoly()
void OSystem_Dreamcast::setPalette(const byte *colors, uint start, uint num)
{
unsigned short *dst = palette + start;
if(num>0)
while( num-- ) {
if (num>0)
while ( num-- ) {
*dst++ = ((colors[0]<<7)&0x7c00)|
((colors[1]<<2)&0x03e0)|
((colors[2]>>3)&0x001f);
@ -150,8 +150,8 @@ void OSystem_Dreamcast::setPalette(const byte *colors, uint start, uint num)
void OSystem_Dreamcast::setCursorPalette(const byte *colors, uint start, uint num)
{
unsigned short *dst = cursor_palette + start;
if(num>0)
while( num-- ) {
if (num>0)
while ( num-- ) {
*dst++ = ((colors[0]<<7)&0x7c00)|
((colors[1]<<2)&0x03e0)|
((colors[2]>>3)&0x001f);
@ -168,8 +168,8 @@ void OSystem_Dreamcast::disableCursorPalette(bool disable)
void OSystem_Dreamcast::grabPalette(byte *colors, uint start, uint num)
{
const unsigned short *src = palette + start;
if(num>0)
while( num-- ) {
if (num>0)
while ( num-- ) {
unsigned short p = *src++;
colors[0] = ((p&0x7c00)>>7)|((p&0x7000)>>12);
colors[1] = ((p&0x03e0)>>2)|((p&0x0380)>>7);
@ -181,10 +181,10 @@ void OSystem_Dreamcast::grabPalette(byte *colors, uint start, uint num)
void OSystem_Dreamcast::setScaling()
{
if(_screen_w > 400) {
if (_screen_w > 400) {
_xscale = _yscale = 1.0;
_top_offset = (SCREEN_H-_screen_h)>>1;
} else if(_aspect_stretch && _screen_w == 320 && _screen_h == 200) {
} else if (_aspect_stretch && _screen_w == 320 && _screen_h == 200) {
_xscale = SCREEN_W/320.0;
_yscale = SCREEN_H/200.0;
_top_offset = 0;
@ -206,22 +206,22 @@ void OSystem_Dreamcast::initSize(uint w, uint h)
_screen_h = h;
_overlay_x = (w-OVL_W)/2;
_overlay_y = (h-OVL_H)/2;
if(_overlay_x<0) _overlay_x = 0;
if(_overlay_y<0) _overlay_y = 0;
if (_overlay_x<0) _overlay_x = 0;
if (_overlay_y<0) _overlay_y = 0;
setScaling();
ta_sync();
if(!screen)
if (!screen)
screen = new unsigned char[SCREEN_W*SCREEN_H];
if(!overlay)
if (!overlay)
overlay = new unsigned short[OVL_W*OVL_H];
for(int i=0; i<NUM_BUFFERS; i++)
if(!screen_tx[i])
for (int i=0; i<NUM_BUFFERS; i++)
if (!screen_tx[i])
screen_tx[i] = ta_txalloc(SCREEN_W*SCREEN_H*2);
for(int i=0; i<NUM_BUFFERS; i++)
if(!mouse_tx[i])
for (int i=0; i<NUM_BUFFERS; i++)
if (!mouse_tx[i])
mouse_tx[i] = ta_txalloc(MOUSE_W*MOUSE_H*2);
for(int i=0; i<NUM_BUFFERS; i++)
if(!ovl_tx[i])
for (int i=0; i<NUM_BUFFERS; i++)
if (!ovl_tx[i])
ovl_tx[i] = ta_txalloc(OVL_TXSTRIDE*OVL_H*2);
_screen_buffer = 0;
_mouse_buffer = 0;
@ -239,7 +239,7 @@ void OSystem_Dreamcast::initSize(uint w, uint h)
void OSystem_Dreamcast::copyRectToScreen(const byte *buf, int pitch, int x, int y,
int w, int h)
{
if(w<1 || h<1)
if (w<1 || h<1)
return;
unsigned char *dst = screen + y*SCREEN_W + x;
do {
@ -293,7 +293,7 @@ void OSystem_Dreamcast::updateScreen(void)
struct polygon_list mypoly;
struct packed_colour_vertex_list myvertex;
if(_screen_dirty) {
if (_screen_dirty) {
_screen_buffer++;
_screen_buffer &= NUM_BUFFERS-1;
@ -301,10 +301,10 @@ void OSystem_Dreamcast::updateScreen(void)
unsigned short *dst = (unsigned short *)screen_tx[_screen_buffer];
unsigned char *src = screen;
// while((*((volatile unsigned int *)(void*)0xa05f810c) & 0x3ff) != 200);
// while ((*((volatile unsigned int *)(void*)0xa05f810c) & 0x3ff) != 200);
// *((volatile unsigned int *)(void*)0xa05f8040) = 0xff0000;
for( int y = 0; y<_screen_h; y++ )
for ( int y = 0; y<_screen_h; y++ )
{
texture_memcpy64_pal( dst, src, _screen_w>>5, palette );
src += SCREEN_W;
@ -314,7 +314,7 @@ void OSystem_Dreamcast::updateScreen(void)
_screen_dirty = false;
}
if( _overlay_visible && _overlay_dirty ) {
if ( _overlay_visible && _overlay_dirty ) {
_overlay_buffer++;
_overlay_buffer &= NUM_BUFFERS-1;
@ -322,7 +322,7 @@ void OSystem_Dreamcast::updateScreen(void)
unsigned short *dst = (unsigned short *)ovl_tx[_overlay_buffer];
unsigned short *src = overlay;
for( int y = 0; y<OVL_H; y++ )
for ( int y = 0; y<OVL_H; y++ )
{
texture_memcpy64( dst, src, OVL_W>>5 );
src += OVL_W;
@ -378,15 +378,15 @@ void OSystem_Dreamcast::updateScreen(void)
ta_commit_end();
if(_overlay_visible) {
if(_overlay_fade < 1.0)
if (_overlay_visible) {
if (_overlay_fade < 1.0)
_overlay_fade += 0.125;
} else {
if(_overlay_fade > 0)
if (_overlay_fade > 0)
_overlay_fade -= 0.125;
}
if(_overlay_fade > 0.0) {
if (_overlay_fade > 0.0) {
mypoly.cmd =
TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST|
@ -432,16 +432,16 @@ void OSystem_Dreamcast::updateScreen(void)
ta_commit_list(&myvertex);
}
if(_softkbd_on)
if(_softkbd_motion < 120)
if (_softkbd_on)
if (_softkbd_motion < 120)
_softkbd_motion += 10;
else
;
else
if(_softkbd_motion > 0)
if (_softkbd_motion > 0)
_softkbd_motion -= 10;
if(_softkbd_motion)
if (_softkbd_motion)
_softkbd.draw(330.0*sin(0.013*_softkbd_motion) - 320.0, 200.0,
120-_softkbd_motion);
@ -467,11 +467,11 @@ void OSystem_Dreamcast::drawMouse(int xdraw, int ydraw, int w, int h,
unsigned short *dst = (unsigned short *)mouse_tx[_mouse_buffer];
int y=0;
if(visible && w && h && w<=MOUSE_W && h<=MOUSE_H)
for(int y=0; y<h; y++) {
if (visible && w && h && w<=MOUSE_W && h<=MOUSE_H)
for (int y=0; y<h; y++) {
int x;
for(x=0; x<w; x++)
if(*buf == _ms_keycolor) {
for (x=0; x<w; x++)
if (*buf == _ms_keycolor) {
*dst++ = 0;
buf++;
} else
@ -527,7 +527,7 @@ void OSystem_Dreamcast::drawMouse(int xdraw, int ydraw, int w, int h,
void OSystem_Dreamcast::mouseToSoftKbd(int x, int y, int &rx, int &ry) const
{
if(_softkbd_motion) {
if (_softkbd_motion) {
rx = (int)(x*_xscale - (330.0*sin(0.013*_softkbd_motion) - 320.0));
ry = (int)(y*_yscale + TOP_OFFSET - 200.0);
} else {
@ -550,7 +550,7 @@ void OSystem_Dreamcast::hideOverlay()
void OSystem_Dreamcast::clearOverlay()
{
if(!_overlay_visible)
if (!_overlay_visible)
return;
memset(overlay, 0, OVL_W*OVL_H*sizeof(unsigned short));
@ -572,7 +572,7 @@ void OSystem_Dreamcast::grabOverlay(int16 *buf, int pitch)
void OSystem_Dreamcast::copyRectToOverlay(const int16 *buf, int pitch,
int x, int y, int w, int h)
{
if(w<1 || h<1)
if (w<1 || h<1)
return;
unsigned short *dst = overlay + y*OVL_W + x;
do {

View file

@ -33,7 +33,7 @@ void Icon::create_vmicon(void *buffer)
unsigned short *pal = (unsigned short *)buffer;
unsigned char *pix = ((unsigned char *)buffer)+32;
for(int n = 0; n<16; n++) {
for (int n = 0; n<16; n++) {
int p = palette[n];
pal[n] =
((p>>16)&0xf000)|
@ -42,7 +42,7 @@ void Icon::create_vmicon(void *buffer)
((p>> 4)&0x000f);
}
for(int line = 0; line < 32; line++) {
for (int line = 0; line < 32; line++) {
memcpy(pix, &bitmap[32/2*(31-line)], 32/2);
pix += 32/2;
}
@ -55,9 +55,9 @@ void Icon::create_texture()
unsigned short *tex = (unsigned short *)ta_txalloc(512);
unsigned short *linebase;
unsigned char *src = bitmap+sizeof(bitmap)-17;
for(int y=0; y<16; y++) {
for (int y=0; y<16; y++) {
linebase = tex + (tt[y]<<1);
for(int x=0; x<16; x++, --src)
for (int x=0; x<16; x++, --src)
linebase[tt[x]] = src[16]|(src[0]<<8);
src -= 16;
}
@ -67,7 +67,7 @@ void Icon::create_texture()
void Icon::setPalette(int pal)
{
unsigned int (*hwpal)[64][16] = (unsigned int (*)[64][16])0xa05f9000;
for(int n = 0; n<16; n++)
for (int n = 0; n<16; n++)
(*hwpal)[pal][n] = palette[n];
}
@ -124,13 +124,13 @@ int Icon::find_unused_pixel()
{
int use[16];
memset(use, 0, sizeof(use));
for(int n=0; n<32*32/2; n++) {
for (int n=0; n<32*32/2; n++) {
unsigned char pix = bitmap[n];
use[pix&0xf]++;
use[pix>>4]++;
}
for(int i=0; i<16; i++)
if(!use[i])
for (int i=0; i<16; i++)
if (!use[i])
return i;
return -1;
}
@ -142,41 +142,41 @@ bool Icon::load_image2(const void *data, int len)
short pla, bitcnt;
int comp, sizeimg, xres, yres, used, imp;
} hdr;
if(len < 40)
if (len < 40)
return false;
memcpy(&hdr, data, 40);
if(hdr.size != 40 || /* hdr.sizeimg<=0 || */ hdr.w<0 || hdr.h<0 ||
if (hdr.size != 40 || /* hdr.sizeimg<=0 || */ hdr.w<0 || hdr.h<0 ||
hdr.bitcnt<0 || hdr.used<0)
return false;
if(!hdr.used)
if (!hdr.used)
hdr.used = 1<<hdr.bitcnt;
hdr.h >>= 1;
/* Fix incorrect sizeimg (The Dig) */
if(hdr.sizeimg < ((hdr.w*hdr.h*(1+hdr.bitcnt)+7)>>3))
if (hdr.sizeimg < ((hdr.w*hdr.h*(1+hdr.bitcnt)+7)>>3))
hdr.sizeimg = ((hdr.w*hdr.h*(1+hdr.bitcnt)+7)>>3);
if(hdr.size + (hdr.used<<2) + hdr.sizeimg > len /* ||
if (hdr.size + (hdr.used<<2) + hdr.sizeimg > len /* ||
hdr.sizeimg < ((hdr.w*hdr.h*(1+hdr.bitcnt)+7)>>3) */)
return false;
if(hdr.w != 32 || hdr.h != 32 || hdr.bitcnt != 4 || hdr.used > 16)
if (hdr.w != 32 || hdr.h != 32 || hdr.bitcnt != 4 || hdr.used > 16)
return false;
memcpy(palette, ((const char *)data)+hdr.size, hdr.used<<2);
memcpy(bitmap, ((const char *)data)+hdr.size+(hdr.used<<2), 32*32/2);
for(int i=0; i<16; i++)
for (int i=0; i<16; i++)
palette[i] |= 0xff000000;
for(int i=hdr.used; i<16; i++)
for (int i=hdr.used; i<16; i++)
palette[i] = 0;
int unused = find_unused_pixel();
if(unused >= 0) {
if (unused >= 0) {
const unsigned char *mask =
((const unsigned char *)data)+hdr.size+(hdr.used<<2)+32*32/2;
unsigned char *pix = bitmap;
for(int y=0; y<32; y++)
for(int x=0; x<32/8; x++) {
for (int y=0; y<32; y++)
for (int x=0; x<32/8; x++) {
unsigned char mbits = *mask++;
for(int z=0; z<4; z++) {
for (int z=0; z<4; z++) {
unsigned char pbits = *pix;
if(mbits & 64) pbits = (pbits & ~0xf) | unused;
if(mbits & 128) pbits = (pbits & 0xf) | (unused << 4);
if (mbits & 64) pbits = (pbits & ~0xf) | unused;
if (mbits & 128) pbits = (pbits & 0xf) | (unused << 4);
*pix++ = pbits;
mbits <<= 2;
}
@ -193,10 +193,10 @@ bool Icon::load_image1(const void *data, int len, int offs)
short pla, bitcnt;
int bytes, offs;
} hdr;
if(len < offs+16)
if (len < offs+16)
return false;
memcpy(&hdr, ((const char *)data)+offs, 16);
if(hdr.bytes > 0 && hdr.offs >= 0 && hdr.offs+hdr.bytes <= len)
if (hdr.bytes > 0 && hdr.offs >= 0 && hdr.offs+hdr.bytes <= len)
return load_image2(((const char *)data)+hdr.offs, hdr.bytes);
else
return false;
@ -208,13 +208,13 @@ bool Icon::load(const void *data, int len, int offs)
memset(bitmap, 0, sizeof(bitmap));
memset(palette, 0, sizeof(palette));
texture = NULL;
if(len < offs+6)
if (len < offs+6)
return false;
memcpy(&hdr, ((const char *)data)+offs, 6);
if(hdr.type != 1 || hdr.cnt < 1 || offs+6+(hdr.cnt<<4) > len)
if (hdr.type != 1 || hdr.cnt < 1 || offs+6+(hdr.cnt<<4) > len)
return false;
for(int i=0; i<hdr.cnt; i++)
if(load_image1(data, len, offs+6+(i<<4)))
for (int i=0; i<hdr.cnt; i++)
if (load_image1(data, len, offs+6+(i<<4)))
return true;
return false;
}
@ -223,11 +223,11 @@ bool Icon::load(const char *filename)
{
char buf[2048];
int fd;
if((fd = open(filename, O_RDONLY))>=0) {
if ((fd = open(filename, O_RDONLY))>=0) {
int sz;
sz = read(fd, buf, sizeof(buf));
close(fd);
if(sz>0)
if (sz>0)
return load(buf, sz);
}
return false;

View file

@ -39,70 +39,70 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y,
static byte lastlmb = 0, lastrmb = 0;
static int8 mouse_wheel = 0, lastwheel = 0;
shiftFlags = 0;
for(int i=0; i<4; i++, pad++)
if(pad->func & MAPLE_FUNC_CONTROLLER) {
for (int i=0; i<4; i++, pad++)
if (pad->func & MAPLE_FUNC_CONTROLLER) {
int buttons = pad->cond.controller.buttons;
if(!(buttons & 0x060e)) exit(0);
if (!(buttons & 0x060e)) exit(0);
if(!(buttons & 4)) lmb++;
if(!(buttons & 2)) rmb++;
if (!(buttons & 4)) lmb++;
if (!(buttons & 2)) rmb++;
if(!(buttons & 8)) newkey = Common::KEYCODE_F5;
else if(!(buttons & 512)) newkey = ' ';
else if(!(buttons & 1024)) newkey = numpadmap[(buttons>>4)&15];
if (!(buttons & 8)) newkey = Common::KEYCODE_F5;
else if (!(buttons & 512)) newkey = ' ';
else if (!(buttons & 1024)) newkey = numpadmap[(buttons>>4)&15];
if(!(buttons & 128)) if(inter) newkey = 1001; else mouse_x++;
if(!(buttons & 64)) if(inter) newkey = 1002; else mouse_x--;
if(!(buttons & 32)) if(inter) newkey = 1003; else mouse_y++;
if(!(buttons & 16)) if(inter) newkey = 1004; else mouse_y--;
if (!(buttons & 128)) if (inter) newkey = 1001; else mouse_x++;
if (!(buttons & 64)) if (inter) newkey = 1002; else mouse_x--;
if (!(buttons & 32)) if (inter) newkey = 1003; else mouse_y++;
if (!(buttons & 16)) if (inter) newkey = 1004; else mouse_y--;
mouse_x += ((int)pad->cond.controller.joyx-128)>>4;
mouse_y += ((int)pad->cond.controller.joyy-128)>>4;
if(pad->cond.controller.ltrigger > 200) newkey = 1005;
else if(pad->cond.controller.rtrigger > 200) newkey = 1006;
if (pad->cond.controller.ltrigger > 200) newkey = 1005;
else if (pad->cond.controller.rtrigger > 200) newkey = 1006;
} else if(pad->func & MAPLE_FUNC_MOUSE) {
} else if (pad->func & MAPLE_FUNC_MOUSE) {
int buttons = pad->cond.mouse.buttons;
if(!(buttons & 4)) lmb++;
if(!(buttons & 2)) rmb++;
if (!(buttons & 4)) lmb++;
if (!(buttons & 2)) rmb++;
if(!(buttons & 8)) newkey = Common::KEYCODE_F5;
if (!(buttons & 8)) newkey = Common::KEYCODE_F5;
mouse_x += pad->cond.mouse.axis1;
mouse_y += pad->cond.mouse.axis2;
mouse_wheel += pad->cond.mouse.axis3;
if(inter)
if (inter)
inter->mouse(mouse_x, mouse_y);
pad->cond.mouse.axis1 = 0;
pad->cond.mouse.axis2 = 0;
pad->cond.mouse.axis3 = 0;
} else if(pad->func & MAPLE_FUNC_KEYBOARD) {
for(int p=0; p<6; p++) {
} else if (pad->func & MAPLE_FUNC_KEYBOARD) {
for (int p=0; p<6; p++) {
int shift = pad->cond.kbd.shift;
int key = pad->cond.kbd.key[p];
if(shift & 0x08) lmb++;
if(shift & 0x80) rmb++;
if(shift & 0x11) shiftFlags |= Common::KBD_CTRL;
if(shift & 0x44) shiftFlags |= Common::KBD_ALT;
if(shift & 0x22) shiftFlags |= Common::KBD_SHIFT;
if(key >= 4 && key <= 0x1d)
if (shift & 0x08) lmb++;
if (shift & 0x80) rmb++;
if (shift & 0x11) shiftFlags |= Common::KBD_CTRL;
if (shift & 0x44) shiftFlags |= Common::KBD_ALT;
if (shift & 0x22) shiftFlags |= Common::KBD_SHIFT;
if (key >= 4 && key <= 0x1d)
newkey = key+('a'-4);
else if(key >= 0x1e && key <= 0x26)
else if (key >= 0x1e && key <= 0x26)
newkey = key+((shift & 0x22)? ('!'-0x1e) : ('1'-0x1e));
else if(key >= 0x59 && key <= 0x61)
else if (key >= 0x59 && key <= 0x61)
newkey = key+('1'-0x59);
else if(key >= 0x2d && key <= 0x38 && key != 0x31)
else if (key >= 0x2d && key <= 0x38 && key != 0x31)
newkey = ((shift & 0x22)?
"=?`{ }+*?<>?" :
"-^@[ ];:?,./")[key - 0x2d];
else if(key >= 0x3a && key <= 0x43)
else if (key >= 0x3a && key <= 0x43)
newkey = key+(Common::KEYCODE_F1-0x3a);
else if(key >= 0x54 && key <= 0x57)
else if (key >= 0x54 && key <= 0x57)
newkey = "/*-+"[key-0x54];
else switch(key) {
case 0x27: case 0x62:
@ -118,17 +118,17 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y,
case 0x2c:
newkey = Common::KEYCODE_SPACE; break;
case 0x4c:
if((shift & 0x11) && (shift & 0x44))
if ((shift & 0x11) && (shift & 0x44))
exit(0);
break;
case 0x4f:
if(inter) newkey = 1001; else mouse_x++; break;
if (inter) newkey = 1001; else mouse_x++; break;
case 0x50:
if(inter) newkey = 1002; else mouse_x--; break;
if (inter) newkey = 1002; else mouse_x--; break;
case 0x51:
if(inter) newkey = 1003; else mouse_y++; break;
if (inter) newkey = 1003; else mouse_y++; break;
case 0x52:
if(inter) newkey = 1004; else mouse_y--; break;
if (inter) newkey = 1004; else mouse_y--; break;
case 0x63:
newkey = '.'; break;
case 0x64: case 0x87:
@ -139,28 +139,28 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y,
}
}
if(lmb && inter && !lastlmb) {
if (lmb && inter && !lastlmb) {
newkey = 1000;
lmb = 0;
}
if(lmb && !lastlmb) {
if (lmb && !lastlmb) {
lastlmb = 1;
return -Common::EVENT_LBUTTONDOWN;
} else if(lastlmb && !lmb) {
} else if (lastlmb && !lmb) {
lastlmb = 0;
return -Common::EVENT_LBUTTONUP;
}
if(rmb && !lastrmb) {
if (rmb && !lastrmb) {
lastrmb = 1;
return -Common::EVENT_RBUTTONDOWN;
} else if(lastrmb && !rmb) {
} else if (lastrmb && !rmb) {
lastrmb = 0;
return -Common::EVENT_RBUTTONUP;
}
if(mouse_wheel != lastwheel)
if(((int8)(mouse_wheel - lastwheel)) > 0) {
if (mouse_wheel != lastwheel)
if (((int8)(mouse_wheel - lastwheel)) > 0) {
lastwheel++;
return -Common::EVENT_WHEELDOWN;
} else {
@ -168,22 +168,22 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y,
return -Common::EVENT_WHEELUP;
}
if(newkey && inter && newkey != lastkey) {
if (newkey && inter && newkey != lastkey) {
int transkey = inter->key(newkey, shiftFlags);
if(transkey) {
if (transkey) {
newkey = transkey;
inter = NULL;
}
}
if(!newkey || (lastkey && newkey != lastkey)) {
if (!newkey || (lastkey && newkey != lastkey)) {
int upkey = lastkey;
lastkey = 0;
if(upkey)
if (upkey)
return upkey | (1<<30);
} else if(!lastkey) {
} else if (!lastkey) {
lastkey = newkey;
if(newkey >= 1000 || !inter)
if (newkey >= 1000 || !inter)
return newkey;
}
@ -194,13 +194,13 @@ bool OSystem_Dreamcast::pollEvent(Common::Event &event)
{
unsigned int t = Timer();
if(_timer != NULL)
if (_timer != NULL)
_timer->handler();
if(((int)(t-_devpoll))<0)
if (((int)(t-_devpoll))<0)
return false;
_devpoll += USEC_TO_TIMER(17000);
if(((int)(t-_devpoll))>=0)
if (((int)(t-_devpoll))>=0)
_devpoll = t + USEC_TO_TIMER(17000);
int mask = getimask();
@ -220,25 +220,25 @@ bool OSystem_Dreamcast::pollEvent(Common::Event &event)
event.mouse.y -= _overlay_y;
}
event.kbd.ascii = event.kbd.keycode = 0;
if(e<0) {
if (e<0) {
event.type = (Common::EventType)-e;
return true;
} else if(e>0) {
} else if (e>0) {
bool processed = false, down = !(e&(1<<30));
e &= ~(1<<30);
if(e < 1000) {
if (e < 1000) {
event.type = (down? Common::EVENT_KEYDOWN : Common::EVENT_KEYUP);
event.kbd.keycode = e;
event.kbd.ascii = (e>='a' && e<='z' && (event.kbd.flags & Common::KBD_SHIFT)?
e &~ 0x20 : e);
processed = true;
} else if(down) {
if(e == 1005)
} else if (down) {
if (e == 1005)
setFeatureState(kFeatureVirtualKeyboard,
!getFeatureState(kFeatureVirtualKeyboard));
}
return processed;
} else if(_ms_cur_x != _ms_old_x || _ms_cur_y != _ms_old_y) {
} else if (_ms_cur_x != _ms_old_x || _ms_cur_y != _ms_old_y) {
event.type = Common::EVENT_MOUSEMOVE;
_ms_old_x = _ms_cur_x;
_ms_old_y = _ms_cur_y;

View file

@ -47,13 +47,13 @@ static void draw_char(unsigned short *dst, int mod, int c, void *font_base)
{
unsigned char *src;
int i, j;
if(c<=32 || c>255 || (c>=127 && c<160)) c=160;
if(c<128) c -= 32; else c -= 64;
if (c<=32 || c>255 || (c>=127 && c<160)) c=160;
if (c<128) c -= 32; else c -= 64;
src = c*36 + (unsigned char *)font_base;
for(i=0; i<12; i++) {
for (i=0; i<12; i++) {
int n = (src[0]<<16)|(src[1]<<8)|src[2];
for(j=0; j<12; j++, n<<=1)
if(n & (1<<23)) {
for (j=0; j<12; j++, n<<=1)
if (n & (1<<23)) {
dst[j] = 0xffff;
dst[j+1] = 0xffff;
dst[j+2] = 0xa108;
@ -61,8 +61,8 @@ static void draw_char(unsigned short *dst, int mod, int c, void *font_base)
dst[j+mod+1] = 0xa108;
}
dst += mod;
for(j=0; j<12; j++, n<<=1)
if(n & (1<<23)) {
for (j=0; j<12; j++, n<<=1)
if (n & (1<<23)) {
dst[j] = 0xffff;
dst[j+1] = 0xffff;
dst[j+2] = 0xa108;
@ -78,15 +78,15 @@ void Label::create_texture(const char *text)
{
void *font = get_romfont_address();
int l = strlen(text);
if(l>64) l=64;
if (l>64) l=64;
int w = 14*l;
for(tex_u=TA_POLYMODE2_U_SIZE_8, u=8; u<w; u<<=1, tex_u += 1<<3);
for (tex_u=TA_POLYMODE2_U_SIZE_8, u=8; u<w; u<<=1, tex_u += 1<<3);
int tsz = u*32;
unsigned short *tex = (unsigned short *)ta_txalloc(tsz*2);
for(int i=0; i<tsz; i++)
for (int i=0; i<tsz; i++)
tex[i] = 0;
int p=l*14;
while(l>0)
while (l>0)
draw_char(tex+(p-=14), u, text[--l], font);
texture = tex;
}

View file

@ -162,7 +162,7 @@ static void detectGames(FSList &files, GameList &candidates)
static bool isIcon(const FilesystemNode &entry)
{
int l = entry.displayName().size();
if(l>4 && !strcasecmp(entry.displayName().c_str()+l-4, ".ICO"))
if (l>4 && !strcasecmp(entry.displayName().c_str()+l-4, ".ICO"))
return true;
else
return false;
@ -172,13 +172,13 @@ static bool loadIcon(Game &game, Dir *dirs, int num_dirs)
{
char icofn[520];
sprintf(icofn, "%s%s.ICO", game.dir, game.filename_base);
if(game.icon.load(icofn))
if (game.icon.load(icofn))
return true;
for(int i=0; i<num_dirs; i++)
if(!strcmp(dirs[i].name, game.dir) &&
for (int i=0; i<num_dirs; i++)
if (!strcmp(dirs[i].name, game.dir) &&
dirs[i].deficon[0]) {
sprintf(icofn, "%s%s", game.dir, dirs[i].deficon);
if(game.icon.load(icofn))
if (game.icon.load(icofn))
return true;
break;
}
@ -193,8 +193,8 @@ static void makeDefIcon(Icon &icon)
static bool uniqueGame(const char *base, const char *dir, Game *games, int cnt)
{
while(cnt--)
if(!strcmp(dir, games->dir) &&
while (cnt--)
if (!strcmp(dir, games->dir) &&
!stricmp(base, games->filename_base))
return false;
else
@ -207,7 +207,7 @@ static int findGames(Game *games, int max)
Dir *dirs = new Dir[MAX_DIR];
int curr_game = 0, curr_dir = 0, num_dirs = 1;
dirs[0].node = FilesystemNode("");
while(curr_game < max && curr_dir < num_dirs) {
while (curr_game < max && curr_dir < num_dirs) {
strncpy(dirs[curr_dir].name, dirs[curr_dir].node.path().c_str(), 252);
dirs[curr_dir].name[251] = '\0';
dirs[curr_dir].deficon[0] = '\0';
@ -216,13 +216,13 @@ static int findGames(Game *games, int max)
for (FSList::const_iterator entry = fslist.begin(); entry != fslist.end();
++entry) {
if (entry->isDirectory()) {
if(num_dirs < MAX_DIR && strcasecmp(entry->displayName().c_str(),
if (num_dirs < MAX_DIR && strcasecmp(entry->displayName().c_str(),
"install")) {
dirs[num_dirs].node = *entry;
num_dirs++;
}
} else
if(isIcon(*entry))
if (isIcon(*entry))
strcpy(dirs[curr_dir-1].deficon, entry->displayName().c_str());
else
files.push_back(*entry);
@ -231,12 +231,12 @@ static int findGames(Game *games, int max)
GameList candidates;
detectGames(files, candidates);
for(GameList::const_iterator ge = candidates.begin();
for (GameList::const_iterator ge = candidates.begin();
ge != candidates.end(); ++ge)
if(curr_game < max) {
if (curr_game < max) {
strcpy(games[curr_game].filename_base, ge->gameid().c_str());
strcpy(games[curr_game].dir, dirs[curr_dir-1].name);
if(uniqueGame(games[curr_game].filename_base,
if (uniqueGame(games[curr_game].filename_base,
games[curr_game].dir, games, curr_game)) {
strcpy(games[curr_game].text, ge->description().c_str());
@ -251,8 +251,8 @@ static int findGames(Game *games, int max)
}
}
for(int i=0; i<curr_game; i++)
if(!loadIcon(games[i], dirs, num_dirs))
for (int i=0; i<curr_game; i++)
if (!loadIcon(games[i], dirs, num_dirs))
makeDefIcon(games[i].icon);
delete[] dirs;
return curr_game;
@ -279,11 +279,11 @@ void waitForDisk()
void *mark = ta_txmark();
lab.create_texture("Please insert game CD.");
//printf("waitForDisk, cdstate = %d\n", getCdState());
for(;;) {
for (;;) {
int s = getCdState();
if(s >= 6)
if (s >= 6)
wasopen = 1;
if(s > 0 && s < 6 && wasopen) {
if (s > 0 && s < 6 && wasopen) {
cdfs_reinit();
chdir("/");
chdir("/");
@ -326,12 +326,12 @@ int gameMenu(Game *games, int num_games)
int top_game = 0, selector_pos = 0;
int mousex = 0, mousey = 0;
if(!num_games)
if (!num_games)
return -1;
for(;;) {
for (;;) {
if(getCdState()>=6)
if (getCdState()>=6)
return -1;
ta_begin_frame();
@ -341,10 +341,10 @@ int gameMenu(Game *games, int num_games)
ta_commit_end();
float y = 40.0;
for(int i=top_game, cnt=0; cnt<10 && i<num_games; i++, cnt++) {
for (int i=top_game, cnt=0; cnt<10 && i<num_games; i++, cnt++) {
int pal = 48+(i&15);
if(cnt == selector_pos)
if (cnt == selector_pos)
draw_trans_quad(100.0, y, 590.0, y+32.0,
0x7000ff00, 0x7000ff00, 0x7000ff00, 0x7000ff00);
@ -364,10 +364,10 @@ int gameMenu(Game *games, int num_games)
event = handleInput(locked_get_pads(), mousex, mousey, shiftFlags);
setimask(mask);
if(event==-Common::EVENT_LBUTTONDOWN || event==Common::KEYCODE_ENTER || event==Common::KEYCODE_F5) {
if (event==-Common::EVENT_LBUTTONDOWN || event==Common::KEYCODE_ENTER || event==Common::KEYCODE_F5) {
int selected_game = top_game + selector_pos;
for(int fade=0; fade<=256; fade+=4) {
for (int fade=0; fade<=256; fade+=4) {
unsigned int fade_colour = 0x00ffffff | ((255-fade)<<24);
@ -379,10 +379,10 @@ int gameMenu(Game *games, int num_games)
float y = 40.0;
if(fade < 256)
for(int i=top_game, cnt=0; cnt<10 && i<num_games;
if (fade < 256)
for (int i=top_game, cnt=0; cnt<10 && i<num_games;
i++, cnt++, y += 40.0)
if(cnt != selector_pos)
if (cnt != selector_pos)
drawGameLabel(games[i], 48+(i&15), 50.0, y, 0xffffff, fade);
y = (40.0/256.0 * (selector_pos + 1))*(256-fade) + 80.0/256.0*fade;
@ -397,16 +397,16 @@ int gameMenu(Game *games, int num_games)
return selected_game;
}
if(mousey>=16) {
if(selector_pos + top_game + 1 < num_games)
if(++selector_pos >= 10) {
if (mousey>=16) {
if (selector_pos + top_game + 1 < num_games)
if (++selector_pos >= 10) {
--selector_pos;
++top_game;
}
mousey -= 16;
} else if(mousey<=-16) {
if(selector_pos + top_game > 0)
if(--selector_pos < 0) {
} else if (mousey<=-16) {
if (selector_pos + top_game > 0)
if (--selector_pos < 0) {
++selector_pos;
--top_game;
}
@ -423,10 +423,10 @@ bool selectGame(char *&ret, char *&dir_ret, Icon &icon)
ta_sync();
void *mark = ta_txmark();
for(;;) {
for (;;) {
num_games = findGames(games, MAX_GAMES);
for(int i=0; i<num_games; i++) {
for (int i=0; i<num_games; i++) {
games[i].icon.create_texture();
games[i].label.create_texture(games[i].text);
}
@ -436,22 +436,22 @@ bool selectGame(char *&ret, char *&dir_ret, Icon &icon)
ta_sync();
ta_txrelease(mark);
if(selected == -1)
if (selected == -1)
waitForDisk();
else
break;
}
if(selected >= num_games)
if (selected >= num_games)
selected = -1;
if(selected >= 0)
if (selected >= 0)
the_game = games[selected];
delete games;
if(selected>=0) {
if (selected>=0) {
#if 0
chdir(the_game.dir);
#else

View file

@ -70,10 +70,10 @@ SoftKeyboard::SoftKeyboard(const OSystem_Dreamcast *_os)
assert((sizeof(key_codes)/sizeof(key_codes[0])) == SK_NUM_KEYS);
const char *np = key_names;
for(int i=0; i<SK_NUM_KEYS; i++) {
for (int i=0; i<SK_NUM_KEYS; i++) {
labels[0][i].create_texture(np);
np += strlen(np)+1;
if(key_codes[i]>8192) {
if (key_codes[i]>8192) {
labels[1][i].create_texture(np);
np += strlen(np)+1;
}
@ -92,19 +92,19 @@ void SoftKeyboard::draw(float x, float y, int transp)
bg_alpha_mask|0x8080ff, bg_alpha_mask|0x8080ff);
x0 = x += 4.0;
y += 4.0;
for(int i=0; i<SK_NUM_KEYS; i++) {
for (int i=0; i<SK_NUM_KEYS; i++) {
float w = (i == 58? 164.0 : 24.0);
unsigned int bg = (i == keySel? bg_alpha_mask|0xffff00 :
bg_alpha_mask|0xc0c0ff);
draw_trans_quad(x, y, x+w, y+24.0, bg, bg, bg, bg);
if(key_codes[i]<0 && (shiftState & ~key_codes[i]))
if (key_codes[i]<0 && (shiftState & ~key_codes[i]))
labels[0][i].draw(x+2, y+5, txt_alpha_mask|0xffffff, 0.5);
else if(key_codes[i]>8192 && (shiftState & Common::KBD_SHIFT))
else if (key_codes[i]>8192 && (shiftState & Common::KBD_SHIFT))
labels[1][i].draw(x+2, y+5, txt_alpha_mask|0x000000, 0.5);
else
labels[0][i].draw(x+2, y+5, txt_alpha_mask|0x000000, 0.5);
x += w+4.0;
if(++c == 11) {
if (++c == 11) {
c = 0;
x = x0;
y += 28.0;
@ -116,41 +116,41 @@ int SoftKeyboard::key(int k, byte &shiftFlags)
{
switch(k) {
case 1001:
if(++keySel == SK_NUM_KEYS)
if (++keySel == SK_NUM_KEYS)
keySel = 0;
break;
case 1002:
if(--keySel < 0)
if (--keySel < 0)
keySel = SK_NUM_KEYS - 1;
break;
case 1003:
if(keySel >= 55) {
if(keySel > 58)
if (keySel >= 55) {
if (keySel > 58)
keySel += 5;
keySel -= 55;
} else if(keySel > 47) {
if((keySel += 6) < 59)
} else if (keySel > 47) {
if ((keySel += 6) < 59)
keySel = 59;
} else
keySel += 11;
break;
case 1004:
if(keySel > 58)
if (keySel > 58)
keySel -= 6;
else if((keySel -= 11) < 0)
if((keySel += 66) > 58)
if((keySel -= 5) < 59)
else if ((keySel -= 11) < 0)
if ((keySel += 66) > 58)
if ((keySel -= 5) < 59)
keySel = 59;
break;
case 1000:
case 13:
case 32:
case 319:
if(key_codes[keySel]<0)
if (key_codes[keySel]<0)
shiftState ^= ~key_codes[keySel];
else {
shiftFlags = shiftState;
if(key_codes[keySel] > 8192)
if (key_codes[keySel] > 8192)
return ((shiftState & Common::KBD_SHIFT)? (key_codes[keySel]>>8):
key_codes[keySel]) & 0xff;
else
@ -164,9 +164,9 @@ int SoftKeyboard::key(int k, byte &shiftFlags)
void SoftKeyboard::mouse(int x, int y)
{
os->mouseToSoftKbd(x, y, x, y);
if(x >= 0 && x < 11*28 && y >= 0 && y < 6*28 &&
if (x >= 0 && x < 11*28 && y >= 0 && y < 6*28 &&
x%28 >= 4 && y%28 >= 4)
if((keySel = 11*(y/28)+(x/28)) > 58)
if((keySel -= 5) < 59)
if ((keySel = 11*(y/28)+(x/28)) > 58)
if ((keySel -= 5) < 59)
keySel = 58;
}

View file

@ -51,8 +51,8 @@ void OSystem_Dreamcast::delayMillis(uint msecs)
getMillis();
unsigned int t, start = Timer();
int time = (((unsigned int)msecs)*3125U)>>6;
while(((int)((t = Timer())-start))<time) {
if(_timer != NULL)
while (((int)((t = Timer())-start))<time) {
if (_timer != NULL)
_timer->handler();
checkSound();
}

View file

@ -87,14 +87,14 @@ static vmsaveResult trySave(const char *gamename, const char *data, int size,
time_t t;
unsigned char iconbuffer[512+32];
if(!vmsfs_check_unit(vm, 0, &info))
if (!vmsfs_check_unit(vm, 0, &info))
return VMSAVE_NOVM;
if(!vmsfs_get_superblock(&info, &super))
if (!vmsfs_get_superblock(&info, &super))
return VMSAVE_NOVM;
int free_cnt = vmsfs_count_free(&super);
if(vmsfs_open_file(&super, filename, &file))
if (vmsfs_open_file(&super, filename, &file))
free_cnt += file.blks;
if(((128+512+size+511)>>9) > free_cnt)
if (((128+512+size+511)>>9) > free_cnt)
return VMSAVE_NOSPACE;
memset(&header, 0, sizeof(header));
@ -117,7 +117,7 @@ static vmsaveResult trySave(const char *gamename, const char *data, int size,
vmsfs_beep(&info, 1);
vmsfs_errno = 0;
if(!vmsfs_create_file(&super, filename, &header,
if (!vmsfs_create_file(&super, filename, &header,
iconbuffer+sizeof(header.palette), NULL,
data, size, &tstamp)) {
fprintf(stderr, "%s\n", vmsfs_describe_error());
@ -140,16 +140,16 @@ static bool tryLoad(char *&buffer, int &size, const char *filename, int vm)
time_t t;
unsigned char iconbuffer[512+32];
if(!vmsfs_check_unit(vm, 0, &info))
if (!vmsfs_check_unit(vm, 0, &info))
return false;
if(!vmsfs_get_superblock(&info, &super))
if (!vmsfs_get_superblock(&info, &super))
return false;
if(!vmsfs_open_file(&super, filename, &file))
if (!vmsfs_open_file(&super, filename, &file))
return false;
buffer = new char[size = file.size];
if(vmsfs_read_file(&file, (unsigned char *)buffer, size))
if (vmsfs_read_file(&file, (unsigned char *)buffer, size))
return true;
delete[] buffer;
@ -165,19 +165,19 @@ static void tryList(const char *prefix, bool *marks, int num, int vm)
struct dir_entry de;
int pl = strlen(prefix);
if(!vmsfs_check_unit(vm, 0, &info))
if (!vmsfs_check_unit(vm, 0, &info))
return;
if(!vmsfs_get_superblock(&info, &super))
if (!vmsfs_get_superblock(&info, &super))
return;
vmsfs_open_dir(&super, &iter);
while(vmsfs_next_dir_entry(&iter, &de))
if(de.entry[0]) {
while (vmsfs_next_dir_entry(&iter, &de))
if (de.entry[0]) {
char buf[16], *endp = NULL;
strncpy(buf, (char *)de.entry+4, 12);
buf[12] = 0;
int l = strlen(buf);
long i = 42;
if(l > pl && !strncmp(buf, prefix, pl) &&
if (l > pl && !strncmp(buf, prefix, pl) &&
(i = strtol(buf+pl, &endp, 10))>=0 && i<num &&
(endp - buf) == l)
marks[i] = true;
@ -189,15 +189,15 @@ vmsaveResult writeSaveGame(const char *gamename, const char *data, int size,
{
vmsaveResult r, res = VMSAVE_NOVM;
if(lastvm >= 0 &&
if (lastvm >= 0 &&
(res = trySave(gamename, data, size, filename, icon, lastvm)) == VMSAVE_OK)
return res;
for(int i=0; i<24; i++)
if((r = trySave(gamename, data, size, filename, icon, i)) == VMSAVE_OK) {
for (int i=0; i<24; i++)
if ((r = trySave(gamename, data, size, filename, icon, i)) == VMSAVE_OK) {
lastvm = i;
return r;
} else if(r > res)
} else if (r > res)
res = r;
return res;
@ -205,12 +205,12 @@ vmsaveResult writeSaveGame(const char *gamename, const char *data, int size,
bool readSaveGame(char *&buffer, int &size, const char *filename)
{
if(lastvm >= 0 &&
if (lastvm >= 0 &&
tryLoad(buffer, size, filename, lastvm))
return true;
for(int i=0; i<24; i++)
if(tryLoad(buffer, size, filename, i)) {
for (int i=0; i<24; i++)
if (tryLoad(buffer, size, filename, i)) {
lastvm = i;
return true;
}
@ -235,7 +235,7 @@ public:
~InVMSave()
{
if(buffer != NULL)
if (buffer != NULL)
delete[] buffer;
}
@ -248,11 +248,11 @@ public:
void tryUncompress()
{
if(_size > 0 && buffer[0] != 'S') {
if (_size > 0 && buffer[0] != 'S') {
// Data does not start with "SCVM". Maybe compressed?
char *expbuf = new char[MAX_SAVE_SIZE];
unsigned long destlen = MAX_SAVE_SIZE;
if(!uncompress((Bytef*)expbuf, &destlen, (Bytef*)buffer, _size)) {
if (!uncompress((Bytef*)expbuf, &destlen, (Bytef*)buffer, _size)) {
delete[] buffer;
buffer = expbuf;
_size = destlen;
@ -294,7 +294,7 @@ public:
virtual Common::InSaveFile *openForLoading(const char *filename) {
InVMSave *s = new InVMSave();
if(s->readSaveGame(filename)) {
if (s->readSaveGame(filename)) {
s->tryUncompress();
return s;
} else {
@ -311,26 +311,26 @@ void OutVMSave::finalize()
extern const char *gGameName;
extern Icon icon;
if(committed >= pos)
if (committed >= pos)
return;
char *data = buffer, *compbuf = NULL;
int len = pos;
if(pos) {
if (pos) {
// Try compression
compbuf = new char[pos];
unsigned long destlen = pos;
if(!compress((Bytef*)compbuf, &destlen, (Bytef*)buffer, pos)) {
if (!compress((Bytef*)compbuf, &destlen, (Bytef*)buffer, pos)) {
data = compbuf;
len = destlen;
}
}
vmsaveResult r = writeSaveGame(gGameName, data, len, filename, icon);
committed = pos;
if(compbuf != NULL)
if (compbuf != NULL)
delete[] compbuf;
if(r != VMSAVE_OK)
if (r != VMSAVE_OK)
iofailed = true;
displaySaveResult(r);
}
@ -375,9 +375,9 @@ void InVMSave::seek(int32 offs, int whence)
_pos = _size + offs;
break;
}
if(_pos < 0)
if (_pos < 0)
_pos = 0;
else if(_pos > _size)
else if (_pos > _size)
_pos = _size;
}
@ -399,7 +399,7 @@ void VMSaveManager::listSavefiles(const char *prefix, bool *marks, int num)
{
memset(marks, false, num*sizeof(bool));
for(int i=0; i<24; i++)
for (int i=0; i<24; i++)
tryList(prefix, marks, num, i);
}

View file

@ -483,7 +483,7 @@ void InterruptTimer3() {
IPC->battery = batt;
IPC->aux = aux;
for(u32 i=0; i<sizeof(ct); i++) {
for (u32 i=0; i<sizeof(ct); i++) {
IPC->curtime[i] = ct[i];
}
@ -527,7 +527,7 @@ void arm7_synctoarm9() { // send fifo message
// interrupt handler to allow incoming notifications from arm9
void arm7_fifo() { // check incoming fifo messages
u32 msg = REG_IPC_FIFO_RX;
if(msg==0x87654321) Wifi_Sync();
if (msg==0x87654321) Wifi_Sync();
}
@ -543,13 +543,13 @@ void initDebugger() {
// sync with arm9 and init wifi
u32 fifo_temp;
while(1) { // wait for magic number
while(REG_IPC_FIFO_CR&IPC_FIFO_RECV_EMPTY) swiWaitForVBlank();
while (1) { // wait for magic number
while (REG_IPC_FIFO_CR&IPC_FIFO_RECV_EMPTY) swiWaitForVBlank();
fifo_temp=REG_IPC_FIFO_RX;
if(fifo_temp==0x12345678) break;
if (fifo_temp==0x12345678) break;
}
while(REG_IPC_FIFO_CR&IPC_FIFO_RECV_EMPTY) swiWaitForVBlank();
while (REG_IPC_FIFO_CR&IPC_FIFO_RECV_EMPTY) swiWaitForVBlank();
fifo_temp=REG_IPC_FIFO_RX; // give next value to wifi_init
Wifi_Init(fifo_temp);

View file

@ -148,7 +148,7 @@ void ComputeDivBy5TableIFN()
return;
isDivBy5Ready = true;
for(int i=0; i<160; ++i)
for (int i=0; i<160; ++i)
{
DIV_BY_5[i] = (2*i+5)/10;
}
@ -311,7 +311,7 @@ static inline void Rescale_320xPAL8Scanline_To_256x1555Scanline(u16* dest, const
{
ComputeDivBy5TableIFN();
for(size_t i=0; i<64; ++i)
for (size_t i=0; i<64; ++i)
{
u32 s0 = palette[src[5*i+0]];
u32 s1 = palette[src[5*i+1]];
@ -325,7 +325,7 @@ static inline void Rescale_320xPAL8Scanline_To_256x1555Scanline(u16* dest, const
#else
static inline void Rescale_320xPAL8Scanline_To_256x1555Scanline(u16* dest, const u8* src, const u16* palette)
{
for(size_t i=0; i<64; ++i)
for (size_t i=0; i<64; ++i)
{
u16 s0 = palette[src[5*i+0]];
u16 s1 = palette[src[5*i+1]];
@ -344,7 +344,7 @@ static inline void Rescale_320x1555Scanline_To_256x1555Scanline(u16* dest, const
{
ComputeDivBy5TableIFN();
for(size_t i=0; i<64; ++i)
for (size_t i=0; i<64; ++i)
{
u16 s0 = src[5*i+0];
u16 s1 = src[5*i+1];
@ -362,7 +362,7 @@ void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, const u16* p
u32 fastRam[768];
// Palette lookup -> 0_888
for(size_t i=0; i<256; ++i)
for (size_t i=0; i<256; ++i)
{
u32 col = palette[i];
u32 result = col & 0x0000001F;
@ -372,7 +372,7 @@ void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, const u16* p
fastRam[i] = result;
}
for(size_t i=0; i<200; ++i)
for (size_t i=0; i<200; ++i)
{
Rescale_320xPAL8Scanline_To_256x1555Scanline(dest + i*destStride, src + i *srcStride, fastRam);
}
@ -381,10 +381,10 @@ void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, const u16* p
void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, const u16* palette, int destStride, int srcStride)
{
u16 fastRam[256];
for(size_t i=0; i<128; ++i)
for (size_t i=0; i<128; ++i)
((u32*)fastRam)[i] = ((const u32*)palette)[i];
for(size_t i=0; i<200; ++i)
for (size_t i=0; i<200; ++i)
{
Rescale_320xPAL8Scanline_To_256x1555Scanline(dest + i*destStride, src + i *srcStride, fastRam);
}
@ -393,7 +393,7 @@ void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, const u16* p
void Rescale_320x256x1555_To_256x256x1555(u16* dest, const u16* src, int destStride, int srcStride)
{
for(size_t i=0; i<200; ++i)
for (size_t i=0; i<200; ++i)
{
Rescale_320x1555Scanline_To_256x1555Scanline(dest + i*destStride, src + i *srcStride);
}

View file

@ -105,7 +105,7 @@ inline static unsigned int _LZ_StringCompare( unsigned char * str1,
{
unsigned int len;
for( len = minlen; (len < maxlen) && (str1[len] == str2[len]); ++ len );
for ( len = minlen; (len < maxlen) && (str1[len] == str2[len]); ++ len );
return len;
}
@ -123,18 +123,18 @@ inline static int _LZ_WriteVarSize( unsigned int x, unsigned char * buf )
/* Determine number of bytes needed to store the number x */
y = x >> 3;
for( num_bytes = 5; num_bytes >= 2; -- num_bytes )
for ( num_bytes = 5; num_bytes >= 2; -- num_bytes )
{
if( y & 0xfe000000 ) break;
if ( y & 0xfe000000 ) break;
y <<= 7;
}
/* Write all bytes, seven bits in each, with 8:th bit set for all */
/* but the last byte. */
for( i = num_bytes-1; i >= 0; -- i )
for ( i = num_bytes-1; i >= 0; -- i )
{
b = (x >> (i*7)) & 0x0000007f;
if( i > 0 )
if ( i > 0 )
{
b |= 0x00000080;
}
@ -164,7 +164,7 @@ inline static int _LZ_ReadVarSize( unsigned int * x, unsigned char * buf )
y = (y << 7) | (b & 0x0000007f);
++ num_bytes;
}
while( b & 0x00000080 );
while ( b & 0x00000080 );
/* Store value in x */
*x = y;
@ -200,26 +200,26 @@ int LZ_Compress( unsigned char *in, unsigned char *out,
unsigned char *ptr1, *ptr2;
/* Do we have anything to compress? */
if( insize < 1 )
if ( insize < 1 )
{
return 0;
}
/* Create histogram */
for( i = 0; i < 256; ++ i )
for ( i = 0; i < 256; ++ i )
{
histogram[ i ] = 0;
}
for( i = 0; i < insize; ++ i )
for ( i = 0; i < insize; ++ i )
{
++ histogram[ in[ i ] ];
}
/* Find the least common byte, and use it as the code marker */
marker = 0;
for( i = 1; i < 256; ++ i )
for ( i = 1; i < 256; ++ i )
{
if( histogram[ i ] < histogram[ marker ] )
if ( histogram[ i ] < histogram[ marker ] )
{
marker = i;
}
@ -237,7 +237,7 @@ int LZ_Compress( unsigned char *in, unsigned char *out,
do
{
/* Determine most distant position */
if( inpos > LZ_MAX_OFFSET ) maxoffset = LZ_MAX_OFFSET;
if ( inpos > LZ_MAX_OFFSET ) maxoffset = LZ_MAX_OFFSET;
else maxoffset = inpos;
/* Get pointer to current position */
@ -246,13 +246,13 @@ int LZ_Compress( unsigned char *in, unsigned char *out,
/* Search history window for maximum length string match */
bestlength = 3;
bestoffset = 0;
for( offset = 3; offset <= maxoffset; ++ offset )
for ( offset = 3; offset <= maxoffset; ++ offset )
{
/* Get pointer to candidate string */
ptr2 = &ptr1[ -offset ];
/* Quickly determine if this is a candidate (for speed) */
if( (ptr1[ 0 ] == ptr2[ 0 ]) &&
if ( (ptr1[ 0 ] == ptr2[ 0 ]) &&
(ptr1[ bestlength ] == ptr2[ bestlength ]) )
{
/* Determine maximum length for this offset */
@ -262,7 +262,7 @@ int LZ_Compress( unsigned char *in, unsigned char *out,
length = _LZ_StringCompare( ptr1, ptr2, 0, maxlength );
/* Better match than any previous match? */
if( length > bestlength )
if ( length > bestlength )
{
bestlength = length;
bestoffset = offset;
@ -271,7 +271,7 @@ int LZ_Compress( unsigned char *in, unsigned char *out,
}
/* Was there a good enough match? */
if( (bestlength >= 8) ||
if ( (bestlength >= 8) ||
((bestlength == 4) && (bestoffset <= 0x0000007f)) ||
((bestlength == 5) && (bestoffset <= 0x00003fff)) ||
((bestlength == 6) && (bestoffset <= 0x001fffff)) ||
@ -288,19 +288,19 @@ int LZ_Compress( unsigned char *in, unsigned char *out,
/* Output single byte (or two bytes if marker byte) */
symbol = in[ inpos ++ ];
out[ outpos ++ ] = symbol;
if( symbol == marker )
if ( symbol == marker )
{
out[ outpos ++ ] = 0;
}
-- bytesleft;
}
}
while( bytesleft > 3 );
while ( bytesleft > 3 );
/* Dump remaining bytes, if any */
while( inpos < insize )
while ( inpos < insize )
{
if( in[ inpos ] == marker )
if ( in[ inpos ] == marker )
{
out[ outpos ++ ] = marker;
out[ outpos ++ ] = 0;
@ -338,7 +338,7 @@ int LZ_CompressFast( unsigned char *in, unsigned char *out,
unsigned char *ptr1, *ptr2;
/* Do we have anything to compress? */
if( insize < 1 )
if ( insize < 1 )
{
return 0;
}
@ -353,11 +353,11 @@ int LZ_CompressFast( unsigned char *in, unsigned char *out,
in[i+1] == in[jumptable[i]+1]. Following the jump table gives a
dramatic boost for the string search'n'match loop compared to doing
a brute force search. */
for( i = 0; i < 65536; ++ i )
for ( i = 0; i < 65536; ++ i )
{
lastindex[ i ] = 0xffffffff;
}
for( i = 0; i < insize-1; ++ i )
for ( i = 0; i < insize-1; ++ i )
{
symbols = (((unsigned int)in[i]) << 8) | ((unsigned int)in[i+1]);
index = lastindex[ symbols ];
@ -367,20 +367,20 @@ int LZ_CompressFast( unsigned char *in, unsigned char *out,
jumptable[ insize-1 ] = 0xffffffff;
/* Create histogram */
for( i = 0; i < 256; ++ i )
for ( i = 0; i < 256; ++ i )
{
histogram[ i ] = 0;
}
for( i = 0; i < insize; ++ i )
for ( i = 0; i < insize; ++ i )
{
++ histogram[ in[ i ] ];
}
/* Find the least common byte, and use it as the code marker */
marker = 0;
for( i = 1; i < 256; ++ i )
for ( i = 1; i < 256; ++ i )
{
if( histogram[ i ] < histogram[ marker ] )
if ( histogram[ i ] < histogram[ marker ] )
{
marker = i;
}
@ -404,13 +404,13 @@ int LZ_CompressFast( unsigned char *in, unsigned char *out,
bestlength = 3;
bestoffset = 0;
index = jumptable[ inpos ];
while( index != 0xffffffff )
while ( index != 0xffffffff )
{
/* Get pointer to candidate string */
ptr2 = &in[ index ];
/* Quickly determine if this is a candidate (for speed) */
if( ptr2[ bestlength ] == ptr1[ bestlength ] )
if ( ptr2[ bestlength ] == ptr1[ bestlength ] )
{
/* Determine maximum length for this offset */
offset = inpos - index;
@ -420,7 +420,7 @@ int LZ_CompressFast( unsigned char *in, unsigned char *out,
length = _LZ_StringCompare( ptr1, ptr2, 2, maxlength );
/* Better match than any previous match? */
if( length > bestlength )
if ( length > bestlength )
{
bestlength = length;
bestoffset = offset;
@ -432,7 +432,7 @@ int LZ_CompressFast( unsigned char *in, unsigned char *out,
}
/* Was there a good enough match? */
if( (bestlength >= 8) ||
if ( (bestlength >= 8) ||
((bestlength == 4) && (bestoffset <= 0x0000007f)) ||
((bestlength == 5) && (bestoffset <= 0x00003fff)) ||
((bestlength == 6) && (bestoffset <= 0x001fffff)) ||
@ -449,19 +449,19 @@ int LZ_CompressFast( unsigned char *in, unsigned char *out,
/* Output single byte (or two bytes if marker byte) */
symbol = in[ inpos ++ ];
out[ outpos ++ ] = symbol;
if( symbol == marker )
if ( symbol == marker )
{
out[ outpos ++ ] = 0;
}
-- bytesleft;
}
}
while( bytesleft > 3 );
while ( bytesleft > 3 );
/* Dump remaining bytes, if any */
while( inpos < insize )
while ( inpos < insize )
{
if( in[ inpos ] == marker )
if ( in[ inpos ] == marker )
{
out[ outpos ++ ] = marker;
out[ outpos ++ ] = 0;
@ -492,7 +492,7 @@ void LZ_Uncompress( unsigned char *in, unsigned char *out,
unsigned int i, inpos, outpos, length, offset;
/* Do we have anything to compress? */
if( insize < 1 )
if ( insize < 1 )
{
return;
}
@ -506,10 +506,10 @@ void LZ_Uncompress( unsigned char *in, unsigned char *out,
do
{
symbol = in[ inpos ++ ];
if( symbol == marker )
if ( symbol == marker )
{
/* We had a marker byte */
if( in[ inpos ] == 0 )
if ( in[ inpos ] == 0 )
{
/* It was a single occurrence of the marker byte */
out[ outpos ++ ] = marker;
@ -522,7 +522,7 @@ void LZ_Uncompress( unsigned char *in, unsigned char *out,
inpos += _LZ_ReadVarSize( &offset, &in[ inpos ] );
/* Copy corresponding data from history window */
for( i = 0; i < length; ++ i )
for ( i = 0; i < length; ++ i )
{
out[ outpos ] = out[ outpos - offset ];
++ outpos;
@ -535,5 +535,5 @@ void LZ_Uncompress( unsigned char *in, unsigned char *out,
out[ outpos ++ ] = symbol;
}
}
while( inpos < insize );
while ( inpos < insize );
}

View file

@ -305,14 +305,14 @@ int getGameHeight() {
}
void initSprites() {
for(int i = 0; i < 128; i++) {
for (int i = 0; i < 128; i++) {
sprites[i].attribute[0] = ATTR0_DISABLED;
sprites[i].attribute[1] = 0;
sprites[i].attribute[2] = 0;
sprites[i].attribute[3] = 0;
}
for(int i = 0; i < 128; i++) {
for (int i = 0; i < 128; i++) {
spritesMain[i].attribute[0] = ATTR0_DISABLED;
spritesMain[i].attribute[1] = 0;
spritesMain[i].attribute[2] = 0;

View file

@ -183,17 +183,17 @@ void OSystem_GP2X::moveStick() {
memcpy(stickBtn, _stickBtn, sizeof(stickBtn));
if((stickBtn[0])||(stickBtn[2])||(stickBtn[4])||(stickBtn[6]))
if ((stickBtn[0])||(stickBtn[2])||(stickBtn[4])||(stickBtn[6]))
stickBtn[1] = stickBtn[3] = stickBtn[5] = stickBtn[7] = 0;
if((stickBtn[1])||(stickBtn[2])||(stickBtn[3])){
if(_km.x_down_count!=2){
if ((stickBtn[1])||(stickBtn[2])||(stickBtn[3])){
if (_km.x_down_count!=2){
_km.x_vel = -1;
_km.x_down_count = 1;
}else
_km.x_vel = -4;
} else if((stickBtn[5])||(stickBtn[6])||(stickBtn[7])){
if(_km.x_down_count!=2){
} else if ((stickBtn[5])||(stickBtn[6])||(stickBtn[7])){
if (_km.x_down_count!=2){
_km.x_vel = 1;
_km.x_down_count = 1;
}else
@ -205,14 +205,14 @@ void OSystem_GP2X::moveStick() {
}
if((stickBtn[0])||(stickBtn[1])||(stickBtn[7])){
if(_km.y_down_count!=2){
if ((stickBtn[0])||(stickBtn[1])||(stickBtn[7])){
if (_km.y_down_count!=2){
_km.y_vel = -1;
_km.y_down_count = 1;
}else
_km.y_vel = -4;
} else if((stickBtn[3])||(stickBtn[4])||(stickBtn[5])){
if(_km.y_down_count!=2){
} else if ((stickBtn[3])||(stickBtn[4])||(stickBtn[5])){
if (_km.y_down_count!=2){
_km.y_vel = 1;
_km.y_down_count = 1;
}else
@ -302,7 +302,7 @@ bool OSystem_GP2X::pollEvent(Common::Event &event) {
GP2X_BUTTON_L & GP2X_BUTTON_A Common::EVENT_PREDICTIVE_DIALOG for predictive text entry box (AGI games)
*/
while(SDL_PollEvent(&ev)) {
while (SDL_PollEvent(&ev)) {
switch(ev.type) {
case SDL_KEYDOWN:{

View file

@ -63,18 +63,18 @@ static volatile unsigned short *MEM_REG;
void GP2X_device_init() {
// Open devices
if(!gp2x_dev[0]) gp2x_dev[0] = open("/dev/mixer", O_RDWR);
if(!gp2x_dev[1]) gp2x_dev[1] = open("/dev/batt", O_RDONLY);
if(!gp2x_dev[2]) gp2x_dev[2] = open("/dev/mem", O_RDWR);
if (!gp2x_dev[0]) gp2x_dev[0] = open("/dev/mixer", O_RDWR);
if (!gp2x_dev[1]) gp2x_dev[1] = open("/dev/batt", O_RDONLY);
if (!gp2x_dev[2]) gp2x_dev[2] = open("/dev/mem", O_RDWR);
}
void GP2X_device_deinit() {
// Close devices
{
int i;
for(i=0;i<8;i++)
for (i=0;i<8;i++)
{
if(gp2x_dev[i])
if (gp2x_dev[i])
{
close(gp2x_dev[i]);
}
@ -211,7 +211,7 @@ void Disable_940(void)
void gp2x_video_wait_vsync(void)
{
MEM_REG[0x2846>>1]=(MEM_REG[0x2846>>1] | 0x20) & ~2;
while(!(MEM_REG[0x2846>>1] & 2));
while (!(MEM_REG[0x2846>>1] & 2));
}
//char GP2X_get_battery_level() {

View file

@ -215,7 +215,7 @@ void WaitACK()
bool bBreak = false;
int iResult;
while(!bBreak) {
while (!bBreak) {
iResult = g_Comm.comm_recv((unsigned char *)g_SendBuffer, 0x100);
if (iResult > 0) {
bBreak = true;
@ -234,7 +234,7 @@ void SendCommand(unsigned char *pCommand)
g_SendBuffer[iOffset++] = '$';
iCheckSum = 0;
while(*pCommand != 0) {
while (*pCommand != 0) {
g_SendBuffer[iOffset++] = *pCommand;
iCheckSum += *pCommand++;
}
@ -285,7 +285,7 @@ void SendCommandSize(unsigned char *pCommand, int iSize)
g_SendBuffer[iOffset++] = '$';
iCheckSum = 0;
while(*pCommand != 0) {
while (*pCommand != 0) {
g_SendBuffer[iOffset++] = *pCommand;
iCheckSum += *pCommand++;
}
@ -340,7 +340,7 @@ void HexToStringBW(char *pString, int iNumber)
// equiv to strcat i imagine
void PrintToString(char *pString, char *pOtherString)
{
while(*pOtherString != 0) {
while (*pOtherString != 0) {
*pString = *pOtherString;
*pString++;
*pOtherString++;
@ -644,7 +644,7 @@ void WriteMemory(void *pAddr, unsigned int uiBytes, char *pHexString)
uiOffset += 2;
}
/*
while(1);
while (1);
unsigned int *piData = (unsigned int *)pAddr;
*piData = 0xe7ffdefe;//0xfedeffe7;
*/
@ -696,7 +696,7 @@ int FindChar(char *pBuffer, char sign)
{
int iRetVal = 0;
while(*pBuffer != sign) {
while (*pBuffer != sign) {
iRetVal++;
*pBuffer++;
}
@ -830,7 +830,7 @@ void ISR()
break;
case MODE_DUNNO:
default:
while(1);
while (1);
}
*/
SendBreakPoint();
@ -928,7 +928,7 @@ void ISR()
case MODE_DUNNO:
default:
//Printf("Dunno!!\n");
while(1);
while (1);
}
@ -1035,13 +1035,13 @@ void BreakPoint()
Printf("Restore: 0x%x", g_SavedStepInstruction);
#endif
} else {
while(1);
while (1);
}
g_LastWasStep = false;
}
while(!bBreakLoop) {
while (!bBreakLoop) {
iResult = RecvUSB(g_ReadBuffer, 0x100);
//Printf("%d\n", iResult);
@ -1061,7 +1061,7 @@ void BreakPoint()
// I can see that i get a bunch of '+' and '-' in the messages.. lets remove them.
iOffsetAdd = 4;
while((g_ReadBuffer[iOffsetAdd] == '+') || (g_ReadBuffer[iOffsetAdd] == '-')) iOffsetAdd++;
while ((g_ReadBuffer[iOffsetAdd] == '+') || (g_ReadBuffer[iOffsetAdd] == '-')) iOffsetAdd++;
// Check whether it's legimit command
if (g_ReadBuffer[iOffsetAdd] == '$') {
@ -1608,7 +1608,7 @@ unsigned int ROR(unsigned int uiValue, unsigned int uiSteps)
{
unsigned int uiRetval;
while(uiSteps-- > 0) {
while (uiSteps-- > 0) {
if (uiValue & 0x01) {
uiValue = (uiValue >> 1) | 0x80000000;
} else {

View file

@ -195,7 +195,7 @@ bool gp_pumpButtonEvent() {
bool gp_pollButtonEvent(GP32BtnEvent *ev) {
gp_pumpButtonEvent();
if(eventQueue.isEmpty()) {
if (eventQueue.isEmpty()) {
return false;
}

View file

@ -114,7 +114,7 @@ void *MemBlock::addBlock(size_t size)
}
blk++;
}
if(i == NUM_BLOCK) {
if (i == NUM_BLOCK) {
blk = &block[0];
for (i = 0; i < prevBlock; i++) {
if (!blk->used) {
@ -122,7 +122,7 @@ void *MemBlock::addBlock(size_t size)
}
blk++;
}
if(i == prevBlock) {
if (i == prevBlock) {
prevBlock = 0;
return gm_malloc(size);
}
@ -289,7 +289,7 @@ void *operator new(size_t size) {
void *ptr = gp_malloc(size);
#if defined(CLEAN_MEMORY_WITH_0xE7)
if(ptr != NULL) {
if (ptr != NULL) {
gp_memset(ptr, 0xE7, size);
}
#endif

View file

@ -235,13 +235,13 @@ void OSystem_PSP::updateScreen() {
}
}
if(_overlayVisible) {
if (_overlayVisible) {
for (int i = 0; i < _screenHeight; ++i) {
for (int j = 0; j < _screenWidth; ++j) {
OverlayColor pixel = _overlayBuffer[(i * _overlayWidth +j)];
if(pixel & 0x8000)
if (pixel & 0x8000)
putPixel(xStart + j, yStart + i, pixel);
}
}
@ -362,7 +362,7 @@ void OSystem_PSP::colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b) {
OverlayColor OSystem_PSP::ARGBToColor(uint8 a, uint8 r, uint8 g, uint8 b) {
OverlayColor color = RGBToColor(r, g, b);
if(a == 255)
if (a == 255)
color |= 0x8000;
return color;
@ -370,7 +370,7 @@ OverlayColor OSystem_PSP::ARGBToColor(uint8 a, uint8 r, uint8 g, uint8 b) {
void OSystem_PSP::colorToARGB(OverlayColor color, uint8 &a, uint8 &r, uint8 &g, uint8 &b) {
colorToRGB(color, r, g, b);
if(color & 0x8000)
if (color & 0x8000)
a = 255;
else
a = 0;
@ -530,7 +530,7 @@ bool OSystem_PSP::pollEvent(Common::Event &event) {
if (newX < 0) newX = 0;
if (newY < 0) newY = 0;
if(_overlayVisible)
if (_overlayVisible)
{
if (newX >= _overlayWidth) newX = _overlayWidth - 1;
if (newY >= _overlayHeight) newY = _overlayHeight - 1;

View file

@ -149,7 +149,7 @@ void OSystem_PSP_GU::initSize(uint width, uint height) {
_kbdClut[0] = 0xffff;
_kbdClut[246] = 0x4ccc;
_kbdClut[247] = 0x0000;
for(int i=1;i<31;i++)
for (int i=1;i<31;i++)
_kbdClut[i] = 0xf888;
_mouseVisible = false;
sceKernelDcacheWritebackAll();
@ -167,8 +167,8 @@ bool OSystem_PSP_GU::setGraphicsMode(int mode) {
bool OSystem_PSP_GU::setGraphicsMode(const char *name) {
int i = 0;
while(s_supportedGraphicsModes[i].name) {
if(!strcmpi(s_supportedGraphicsModes[i].name, name)) {
while (s_supportedGraphicsModes[i].name) {
if (!strcmpi(s_supportedGraphicsModes[i].name, name)) {
_graphicMode = s_supportedGraphicsModes[i].id;
return true;
}
@ -196,7 +196,7 @@ void OSystem_PSP_GU::setMouseCursor(const byte *buf, uint w, uint h, int hotspot
mouseClut[_mouseKeyColour] = 0;
sceKernelDcacheWritebackAll();
for(unsigned int i=0;i<h;i++)
for (unsigned int i=0;i<h;i++)
memcpy(_mouseBuf+i*MOUSE_SIZE, buf+i*w, w);
}
@ -277,7 +277,7 @@ void OSystem_PSP_GU::updateScreen() {
sceGuClutMode(GU_PSM_5551, 0, 0xff, 0);
sceGuClutLoad(32, clut256); // upload 32*8 entries (256)
sceGuTexMode(GU_PSM_T8, 0, 0, 0); // 8-bit image
if(_screenWidth == 320)
if (_screenWidth == 320)
sceGuTexImage(0, 512, 256, _screenWidth, _offscreen);
else
sceGuTexImage(0, 512, 512, _screenWidth, _offscreen);
@ -315,7 +315,7 @@ void OSystem_PSP_GU::updateScreen() {
}
sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices);
if(_screenWidth == 640) {
if (_screenWidth == 640) {
sceGuTexImage(0, 512, 512, _screenWidth, _offscreen+512);
vertices[0].u = 512 + 0.5; vertices[1].v = _screenHeight - 0.5;
vertices[0].x += (vertices[1].x - vertices[0].x) * 511 / 640; vertices[0].y = 0; vertices[0].z = 0;
@ -324,7 +324,7 @@ void OSystem_PSP_GU::updateScreen() {
// draw overlay
if(_overlayVisible) {
if (_overlayVisible) {
vertices[0].x = 0; vertices[0].y = 0; vertices[0].z = 0;
vertices[1].x = PSP_SCREEN_WIDTH; vertices[1].y = PSP_SCREEN_HEIGHT; vertices[1].z = 0;
vertices[0].u = 0.5; vertices[0].v = 0.5;
@ -340,7 +340,7 @@ void OSystem_PSP_GU::updateScreen() {
sceGuTexFunc(GU_TFX_MODULATE, GU_TCC_RGBA);
sceGuDrawArray(GU_SPRITES,GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D,2,0,vertices);
// need to render twice for textures > 512
if( _overlayWidth > 512) {
if ( _overlayWidth > 512) {
sceGuTexImage(0, 512, 512, _overlayWidth, _overlayBuffer + 512);
vertices[0].u = 512 + 0.5; vertices[1].v = _overlayHeight - 0.5;
vertices[0].x = PSP_SCREEN_WIDTH * 512 / 640; vertices[0].y = 0; vertices[0].z = 0;
@ -365,7 +365,7 @@ void OSystem_PSP_GU::updateScreen() {
int mX = _mouseX - _mouseHotspotX;
int mY = _mouseY - _mouseHotspotY;
if(_overlayVisible) {
if (_overlayVisible) {
float scalex, scaley;
scalex = (float)PSP_SCREEN_WIDTH /_overlayWidth;
@ -417,7 +417,7 @@ void OSystem_PSP_GU::updateScreen() {
sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices);
}
if(_keyboardVisible) {
if (_keyboardVisible) {
sceGuTexMode(GU_PSM_T8, 0, 0, 0); // 8-bit image
sceGuClutMode(GU_PSM_4444, 0, 0xff, 0);
sceGuClutLoad(32, kbClut); // upload 32*8 entries (256)
@ -469,13 +469,13 @@ bool OSystem_PSP_GU::pollEvent(Common::Event &event) {
uint32 buttonsChanged = pad.Buttons ^ _prevButtons;
if ((buttonsChanged & PSP_CTRL_SELECT) || (pad.Buttons & PSP_CTRL_SELECT)) {
if( !(pad.Buttons & PSP_CTRL_SELECT) )
if ( !(pad.Buttons & PSP_CTRL_SELECT) )
_keyboardVisible = !_keyboardVisible;
_prevButtons = pad.Buttons;
return false;
}
if(!_keyboardVisible)
if (!_keyboardVisible)
return OSystem_PSP::pollEvent(event);
if ( (buttonsChanged & PSP_CTRL_RTRIGGER) && !(pad.Buttons & PSP_CTRL_RTRIGGER))
@ -520,17 +520,17 @@ bool OSystem_PSP_GU::pollEvent(Common::Event &event) {
x = pad.Lx-128;
y = pad.Ly-128;
_kbdClut[_keySelected] = 0xf888;
if(x*x + y*y > 10000) {
if (x*x + y*y > 10000) {
nub_angle = atan2(y, x);
_keySelected = (int)(1 + (M_PI + nub_angle) * 30 / (2 * M_PI));
_keySelected -= 2;
if(_keySelected < 1)
if (_keySelected < 1)
_keySelected += 30;
_kbdClut[_keySelected] = 0xffff;
if (buttonsChanged & PSP_CTRL_CROSS) {
event.type = (pad.Buttons & PSP_CTRL_CROSS) ? Common::EVENT_KEYDOWN : Common::EVENT_KEYUP;
if(_keySelected > 26) {
if (_keySelected > 26) {
event.kbd.flags = 0;
switch(_keySelected) {
case 27:
@ -570,7 +570,7 @@ bool OSystem_PSP_GU::pollEvent(Common::Event &event) {
}
break;
case (SYMBOLS|CAPS_LOCK):
if(_keySelected < 21) {
if (_keySelected < 21) {
event.kbd.flags = 0;
event.kbd.ascii = kbd_ascii_cl[_keySelected-1];
event.kbd.keycode = kbd_code_cl[ _keySelected-1];

View file

@ -41,7 +41,7 @@ void PSPDebugTrace (const char *format, ...) {
fd = sceIoOpen("MS0:/DTRACE.TXT", PSP_O_RDWR | PSP_O_CREAT | PSP_O_APPEND, 0777);
if(fd <= 0)
if (fd <= 0)
{
return;
}
@ -63,7 +63,7 @@ void PSPDebugTrace (const char * filename, const char *format, ...) {
fd = sceIoOpen(filename, PSP_O_RDWR | PSP_O_CREAT | PSP_O_APPEND, 0777);
if(fd <= 0)
if (fd <= 0)
{
return;
}

View file

@ -55,7 +55,7 @@ CEikAppUi *CScummVMDoc::CreateAppUiL() {
}
void CScummVMUi::HandleForegroundEventL(TBool aForeground) {
if(aForeground) {
if (aForeground) {
BringUpEmulatorL();
}
}
@ -64,7 +64,7 @@ CScummVMUi::CScummVMUi() {
}
CScummVMUi::~CScummVMUi() {
if(iWatcher) {
if (iWatcher) {
iThreadWatch.LogonCancel(iWatcher->iStatus);
iWatcher->Cancel();
}
@ -109,10 +109,10 @@ void CScummVMUi::ConstructL() {
iExeWgId=exeTask.WgId();
exeTask.BringToForeground();
if(iExeWgId == myTask.WgId()) { // Should n't be the same
if (iExeWgId == myTask.WgId()) { // Should n't be the same
Exit();
}
if(iThreadWatch.Open(iThreadId) == KErrNone) {
if (iThreadWatch.Open(iThreadId) == KErrNone) {
iWatcher = new (ELeave)CScummWatcher;
iWatcher->iAppUi = this;
iThreadWatch.Logon(iWatcher->iStatus);
@ -139,7 +139,7 @@ void CScummWatcher::RunL() {
void CScummVMUi::BringUpEmulatorL() {
RThread thread;
if(thread.Open(iThreadId) == KErrNone) {
if (thread.Open(iThreadId) == KErrNone) {
thread.Close();
TApaTask apaTask(iEikonEnv->WsSession());
apaTask.SetWgId(iExeWgId);
@ -155,7 +155,7 @@ void CScummVMUi::HandleCommandL(TInt aCommand) {
case EEikCmdExit:
{
RThread thread;
if(thread.Open(iThreadId) == KErrNone) {
if (thread.Open(iThreadId) == KErrNone) {
thread.Terminate(0);
thread.Close();
}

View file

@ -351,7 +351,7 @@ bool OSystem_SDL_Symbian::remapKey(SDL_Event &ev, Common::Event &event) {
case GUI::ACTION_MULTI: {
GUI::Key &key = GUI::Actions::Instance()->getKeyAction(loop);
// if key code is pause, then change event to interactive or just fall through
if(key.keycode() == SDLK_PAUSE) {
if (key.keycode() == SDLK_PAUSE) {
event.type = Common::EVENT_PREDICTIVE_DIALOG;
return true;
}
@ -371,7 +371,7 @@ bool OSystem_SDL_Symbian::remapKey(SDL_Event &ev, Common::Event &event) {
// Translate from SDL keymod event to Scummvm Key Mod Common::Event.
// This codes is also present in GP32 backend and in SDL backend as a static function
// Perhaps it should be shared.
if(key.flags() != 0) {
if (key.flags() != 0) {
event.kbd.flags = 0;
if (ev.key.keysym.mod & KMOD_SHIFT)

View file

@ -57,12 +57,12 @@ int stat(const char *fname, struct stat *ss)
HANDLE handle;
int len;
if(fname == NULL || ss == NULL)
if (fname == NULL || ss == NULL)
return -1;
/* Special case (dummy on WinCE) */
len = strlen(fname);
if(len >= 2 && fname[len-1] == '.' && fname[len-2] == '.' &&
if (len >= 2 && fname[len-1] == '.' && fname[len-2] == '.' &&
(len == 2 || fname[len-3] == '\\'))
{
/* That's everything implemented so far */
@ -74,14 +74,14 @@ int stat(const char *fname, struct stat *ss)
MultiByteToWideChar(CP_ACP, 0, fname, -1, fnameUnc, MAX_PATH);
handle = FindFirstFile(fnameUnc, &wfd);
if(handle == INVALID_HANDLE_VALUE)
if (handle == INVALID_HANDLE_VALUE)
return -1;
else
{
/* That's everything implemented so far */
memset(ss, 0, sizeof(struct stat));
ss->st_size = wfd.nFileSizeLow;
if(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
ss->st_mode |= S_IFDIR;
FindClose(handle);
@ -98,7 +98,7 @@ EXT_C time_t time(time_t* res)
t = (time_t)(((((((st.wYear-1970)*12+st.wMonth)*31+st.wDay)*7+st.wDayOfWeek)*24+st.wHour)*60+st.wMinute)*60+st.wSecond);
if(res)
if (res)
*res = t;
return t;
}
@ -131,18 +131,18 @@ EXT_C char *getcwd(char *buffer, int maxlen)
TCHAR fileUnc[MAX_PATH+1];
char* plast;
if(cwd[0] == 0)
if (cwd[0] == 0)
{
GetModuleFileName(NULL, fileUnc, MAX_PATH);
WideCharToMultiByte(CP_ACP, 0, fileUnc, -1, cwd, MAX_PATH, NULL, NULL);
plast = strrchr(cwd, '\\');
if(plast)
if (plast)
*plast = 0;
/* Special trick to keep start menu clean... */
if(_stricmp(cwd, "\\windows\\start menu") == 0)
if (_stricmp(cwd, "\\windows\\start menu") == 0)
strcpy(cwd, "\\Apps");
}
if(buffer)
if (buffer)
strncpy(buffer, cwd, maxlen);
return cwd;
}
@ -165,9 +165,9 @@ EXT_C FILE *wce_fopen(const char* fname, const char* fmode)
{
char fullname[MAX_PATH+1];
if(!fname || fname[0] == '\0')
if (!fname || fname[0] == '\0')
return NULL;
if(fname[0] != '\\' && fname[0] != '/')
if (fname[0] != '\\' && fname[0] != '/')
{
getcwd(fullname, MAX_PATH);
strncat(fullname, "\\", MAX_PATH-strlen(fullname)-1);
@ -190,11 +190,11 @@ DIR* opendir(const char* fname)
TCHAR fnameUnc[MAX_PATH+1];
char nameFound[MAX_PATH+1];
if(fname == NULL)
if (fname == NULL)
return NULL;
strcpy(fnameMask, fname);
if(!strlen(fnameMask) || fnameMask[strlen(fnameMask)-1] != '\\')
if (!strlen(fnameMask) || fnameMask[strlen(fnameMask)-1] != '\\')
strncat(fnameMask, "\\", MAX_PATH-strlen(fnameMask)-1);
strncat(fnameMask, "*.*", MAX_PATH-strlen(fnameMask)-4);
@ -209,7 +209,7 @@ DIR* opendir(const char* fname)
strcpy(pdir->dd_name, fname); /* it has exactly enough space for fname and nul char */
MultiByteToWideChar(CP_ACP, 0, fnameMask, -1, fnameUnc, MAX_PATH);
if((pdir->dd_handle = (long)FindFirstFile(fnameUnc, &wfd)) == (long)INVALID_HANDLE_VALUE)
if ((pdir->dd_handle = (long)FindFirstFile(fnameUnc, &wfd)) == (long)INVALID_HANDLE_VALUE)
{
free(pdir);
return NULL;
@ -229,35 +229,35 @@ struct dirent* readdir(DIR* dir)
char nameFound[MAX_PATH+1];
static struct dirent dummy;
if(dir->dd_stat == 0)
if (dir->dd_stat == 0)
{
dummy.d_name = ".";
dummy.d_namlen = 1;
dir->dd_stat ++;
return &dummy;
}
else if(dir->dd_stat == 1)
else if (dir->dd_stat == 1)
{
dummy.d_name = "..";
dummy.d_namlen = 2;
dir->dd_stat ++;
return &dummy;
}
else if(dir->dd_stat == 2)
else if (dir->dd_stat == 2)
{
dir->dd_stat++;
return &dir->dd_dir;
}
else
{
if(FindNextFile((HANDLE)dir->dd_handle, &wfd) == 0)
if (FindNextFile((HANDLE)dir->dd_handle, &wfd) == 0)
{
dir->dd_stat = -1;
return NULL;
}
WideCharToMultiByte(CP_ACP, 0, wfd.cFileName, -1, nameFound, MAX_PATH, NULL, NULL);
if(dir->dd_dir.d_name)
if (dir->dd_dir.d_name)
free(dir->dd_dir.d_name);
dir->dd_dir.d_name = strdup(nameFound);
@ -271,13 +271,13 @@ struct dirent* readdir(DIR* dir)
int closedir(DIR* dir)
{
if(dir == NULL)
if (dir == NULL)
return 0;
if(dir->dd_handle)
if (dir->dd_handle)
FindClose((HANDLE)dir->dd_handle);
if(dir->dd_dir.d_name)
if (dir->dd_dir.d_name)
free(dir->dd_dir.d_name);
free(dir);
return 1;
@ -304,12 +304,12 @@ void mkdir(char* dirname, int mode)
TCHAR pathUnc[MAX_PATH+1];
char* ptr;
strncpy(path, dirname, MAX_PATH);
if(*path == '/')
if (*path == '/')
*path = '\\';
/* Run through the string and attempt creating all subdirs on the path */
for(ptr = path+1; *ptr; ptr ++)
for (ptr = path+1; *ptr; ptr ++)
{
if(*ptr == '\\' || *ptr == '/')
if (*ptr == '\\' || *ptr == '/')
{
*ptr = 0;
MultiByteToWideChar(CP_ACP, 0, path, -1, pathUnc, MAX_PATH);
@ -333,7 +333,7 @@ char *tmpnam(char *string)
GetTempFileName(TEXT("."), TEXT("A8_"), 0, pTemp);
WideCharToMultiByte(CP_ACP, 0, pTemp, -1, buffer, MAX_PATH, NULL, NULL);
if(string)
if (string)
{
strcpy(string, buffer);
return string;
@ -345,7 +345,7 @@ char *tmpnam(char *string)
FILE *tmpfile()
{
TCHAR pTemp[MAX_PATH+1];
if(!GetTempFileName(TEXT("."), TEXT("A8_"), 0, pTemp))
if (!GetTempFileName(TEXT("."), TEXT("A8_"), 0, pTemp))
return _wfopen(pTemp, TEXT("w+b"));
else
return 0;
@ -374,7 +374,7 @@ char *strdup(const char *strSource)
{
char* buffer;
buffer = (char*)malloc(strlen(strSource)+1);
if(buffer)
if (buffer)
strcpy(buffer, strSource);
return buffer;
}
@ -390,7 +390,7 @@ void gettimeofday(struct timeval* tp, void* dummy)
void usleep(long usec)
{
long msec = usec/1000;
if(msec <= 0)
if (msec <= 0)
Sleep(0);
else
Sleep(msec);
@ -417,7 +417,7 @@ at least allows some projects to work.
char* getenv(char* name)
{
static char buffer[MAX_PATH+1];
if(strcmp(name, "HOME") == 0 || strcmp(name, "HOMEDIR") == 0)
if (strcmp(name, "HOME") == 0 || strcmp(name, "HOMEDIR") == 0)
{
getcwd(buffer, MAX_PATH);
return buffer;

View file

@ -172,7 +172,7 @@ int SDL_main(int argc, char **argv) {
extern void (*__CTOR_LIST__)() ;
void (**constructor)() = &__CTOR_LIST__ ;
constructor++ ;
while(*constructor) {
while (*constructor) {
(*constructor)() ;
constructor++ ;
}
@ -2141,7 +2141,7 @@ bool OSystem_WINCE3::pollEvent(Common::Event &event) {
currentTime = GetTickCount();
while(SDL_PollEvent(&ev)) {
while (SDL_PollEvent(&ev)) {
switch(ev.type) {
case SDL_KEYDOWN:
debug(1, "Key down %X %s", ev.key.keysym.sym, SDL_GetKeyName((SDLKey)ev.key.keysym.sym));

View file

@ -69,7 +69,7 @@ public:
assert(header == 0x1F8B ||
((header & 0x0F00) == 0x0800 && header % 31 == 0));
if(header == 0x1F8B) {
if (header == 0x1F8B) {
// Retrieve the original file size
w->seek(-4, SEEK_END);
_origSize = w->readUint32LE();

View file

@ -388,9 +388,9 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, char **ar
DO_OPTION('p', "path")
FilesystemNode path(option);
if(!path.exists()) {
if (!path.exists()) {
usage("Non-existent game path '%s'", option);
} else if(!path.isReadable()) {
} else if (!path.isReadable()) {
usage("Non-readable game path '%s'", option);
}
END_OPTION
@ -431,9 +431,9 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, char **ar
DO_LONG_OPTION("soundfont")
FilesystemNode path(option);
if(!path.exists()) {
if (!path.exists()) {
usage("Non-existent soundfont path '%s'", option);
} else if(!path.isReadable()) {
} else if (!path.isReadable()) {
usage("Non-readable soundfont path '%s'", option);
}
END_OPTION
@ -461,9 +461,9 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, char **ar
DO_LONG_OPTION("savepath")
FilesystemNode path(option);
if(!path.exists()) {
if (!path.exists()) {
usage("Non-existent savegames path '%s'", option);
} else if(!path.isWritable()) {
} else if (!path.isWritable()) {
usage("Non-writable savegames path '%s'", option);
}
END_OPTION
@ -479,9 +479,9 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, char **ar
DO_LONG_OPTION("themepath")
FilesystemNode path(option);
if(!path.exists()) {
if (!path.exists()) {
usage("Non-existent theme path '%s'", option);
} else if(!path.isReadable()) {
} else if (!path.isReadable()) {
usage("Non-readable theme path '%s'", option);
}
END_OPTION
@ -691,9 +691,9 @@ bool processSettings(Common::String &command, Common::StringMap &settings) {
const char *dir = getenv("SCUMMVM_SAVEPATH");
if (dir && *dir && strlen(dir) < MAXPATHLEN) {
FilesystemNode saveDir(dir);
if(!saveDir.exists()) {
if (!saveDir.exists()) {
warning("Non-existent SCUMMVM_SAVEPATH save path. It will be ignored.");
} else if(!saveDir.isWritable()) {
} else if (!saveDir.isWritable()) {
warning("Non-writable SCUMMVM_SAVEPATH save path. It will be ignored.");
} else {
settings["savepath"] = dir;

View file

@ -411,9 +411,9 @@ bool File::open(const FilesystemNode &node, AccessMode mode) {
bool File::remove(const String &filename){
if (remove(filename.c_str()) != 0) {
if(errno == EACCES)
if (errno == EACCES)
;//TODO: read-only file
if(errno == ENOENT)
if (errno == ENOENT)
;//TODO: non-existent file
return false;
@ -424,9 +424,9 @@ bool File::remove(const String &filename){
bool File::remove(const FilesystemNode &node){
if (remove(node.getPath()) != 0) {
if(errno == EACCES)
if (errno == EACCES)
;//TODO: read-only file
if(errno == ENOENT)
if (errno == ENOENT)
;//TODO: non-existent file
return false;

View file

@ -47,7 +47,7 @@ static bool matchString(const char *str, const char *pat) {
if (p) {
pat = p;
str = ++q;
if(!*str)
if (!*str)
return !*pat;
break;
}
@ -56,7 +56,7 @@ static bool matchString(const char *str, const char *pat) {
}
// fallthrough
case '?':
if(!*str)
if (!*str)
return !*pat;
pat++;
str++;

View file

@ -246,7 +246,7 @@ void md5_finish(md5_context *ctx, uint8 digest[16]) {
}
bool md5_file(const FilesystemNode &file, uint8 digest[16], uint32 length) {
if(!file.exists()) {
if (!file.exists()) {
warning("md5_file: using an inexistent FilesystemNode");
return false;
} else if (!file.isReadable()) {

View file

@ -994,7 +994,7 @@ cmd(version) {
/* insert our version into the other version */
len = strlen(verMsg);
gap = r - q;
if(gap < 0)
if (gap < 0)
gap = 0;
else
gap = (gap - len) / 2;

View file

@ -99,7 +99,7 @@ void PictureMgr::drawLine(int x1, int y1, int x2, int y2) {
int i, x, y, deltaX, deltaY, stepX, stepY, errorX, errorY, detdelta;
/* CM: Do clipping */
#define clip(x, y) if((x)>=(y)) (x)=(y)
#define clip(x, y) if ((x)>=(y)) (x)=(y)
clip(x1, _width - 1);
clip(x2, _width - 1);
clip(y1, _height - 1);

View file

@ -664,14 +664,14 @@ void Winnie::incMenuSel(int *iSel, int fCanSel[]) {
do {
*iSel += 1;
if (*iSel > IDI_WTP_SEL_DROP) *iSel = IDI_WTP_SEL_OPT_1;
} while(!fCanSel[*iSel]);
} while (!fCanSel[*iSel]);
}
void Winnie::decMenuSel(int *iSel, int fCanSel[]) {
do {
*iSel -= 1;
if (*iSel < IDI_WTP_SEL_OPT_1) *iSel = IDI_WTP_SEL_DROP;
} while(!fCanSel[*iSel]);
} while (!fCanSel[*iSel]);
}
void Winnie::getMenuMouseSel(int *iSel, int fCanSel[], int x, int y) {
@ -1046,7 +1046,7 @@ bool Winnie::getSelOkBack() {
}
void Winnie::clrMenuSel(int *iSel, int fCanSel[]) {
*iSel = IDI_WTP_SEL_OPT_1;
while(!fCanSel[*iSel]) {
while (!fCanSel[*iSel]) {
*iSel += 1;
}
}

View file

@ -969,7 +969,7 @@ int AGOSEngine::go() {
(getFeatures() & GF_DEMO)) {
int i;
while(1) {
while (1) {
for (i = 0; i < 4; i++) {
setWindowImage(3, 9902 + i);
debug(0, "Displaying image %d", 9902 + i);

View file

@ -410,7 +410,7 @@ Item *AGOSEngine::findInByClass(Item *i, int16 m) {
Item *AGOSEngine::nextInByClass(Item *i, int16 m) {
i = _findNextPtr;
while(i) {
while (i) {
if (i->classFlags & m) {
_findNextPtr = derefItem(i->next);
return i;

View file

@ -50,14 +50,14 @@ int AGOSEngine::countSaveGames() {
memset(marks, false, 256 * sizeof(bool)); //assume no savegames for this title
filenames = _saveFileMan->listSavefiles(prefix);
for(Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); file++){
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); file++){
//Obtain the last 3 digits of the filename, since they correspond to the save slot
slot[0] = file->c_str()[file->size()-3];
slot[1] = file->c_str()[file->size()-2];
slot[2] = file->c_str()[file->size()-1];
slotNum = atoi(slot);
if(slotNum >= 0 && slotNum < 256)
if (slotNum >= 0 && slotNum < 256)
marks[slotNum] = true; //mark this slot as valid
}

View file

@ -93,7 +93,7 @@ int loadBackground(char *name, int idx) {
printf("Loading BG: %s\n", name);
if (!backgroundPtrtable[idx]) {
//if(!gfxModuleData.useEGA && !gfxModuleData.useVGA)
//if (!gfxModuleData.useEGA && !gfxModuleData.useVGA)
{
backgroundPtrtable[idx] =
(uint8 *) mallocAndZero(320 * 200 /*64000 */ );
@ -174,7 +174,7 @@ int loadBackground(char *name, int idx) {
}
}
//if(ptrToFree != gfxModuleData.pPage10)
//if (ptrToFree != gfxModuleData.pPage10)
// free(ptrToFree);
if (gfxModuleData.useEGA || gfxModuleData.useTandy) {

View file

@ -125,7 +125,7 @@ backgroundIncrustStruct *addBackgroundIncrust(int16 overlayIdx,
(char *)filesDatabase[params.fileIdx].subData.ptr);
// ASSERT(0);
} else { // poly
/* if(param4 == 1)
/* if (param4 == 1)
* {
* int var_A;
* int var_8;

View file

@ -37,7 +37,7 @@ void resetPtr(cellStruct *ptr) {
void freeMessageList(cellStruct *objPtr) {
/* if (objPtr) {
if(objPtr->next)
if (objPtr->next)
free(objPtr->next);
free(objPtr);

View file

@ -351,12 +351,12 @@ int loadFileSub1(uint8 **ptr, uint8 *name, uint8 *ptr2) {
if (!strcmp(buffer, ".SPL")) {
removeExtention((char *)name, buffer);
// if(useH32)
// if (useH32)
{
strcatuint8(buffer, ".H32");
}
/* else
* if(useAdlib)
* if (useAdlib)
* {
* strcatuint8(buffer,".ADL");
* }
@ -687,7 +687,7 @@ int getCursorFromObject(int mouseX, int mouseY, int *outX, int *outY) {
di += var_10;
}
/* if((filesDatabase[di].subData.resourceType == 8) && (filesDatabase[di].subData.ptr)) {
/* if ((filesDatabase[di].subData.resourceType == 8) && (filesDatabase[di].subData.ptr)) {
assert(0);
}
*/
@ -1045,7 +1045,7 @@ int processInput(void) {
int16 mouseY = 0;
int16 button = 0;
/*if(inputSub1keyboad())
/*if (inputSub1keyboad())
* {
* return 1;
* } */
@ -1327,7 +1327,7 @@ void mainLoop(void) {
// readKeyboard();
playerDontAskQuit = processInput();
//if(enableUser)
//if (enableUser)
{
userEnabled = 1;
enableUser = 0;
@ -1363,7 +1363,7 @@ void mainLoop(void) {
if (main5)
fadeVar = 0;
/*if(fadeVar)
/*if (fadeVar)
* {
* // TODO!
* } */
@ -1371,11 +1371,11 @@ void mainLoop(void) {
mainDraw(0);
flipScreen();
/* if(userEnabled && !main7 && !main15 && currentActiveMenu == -1)
/* if (userEnabled && !main7 && !main15 && currentActiveMenu == -1)
* {
* getMouseStatus(&main10, &mouseX, &mouseButton, &mouseY);
*
* if(mouseX != oldMouseX && mouseY != oldMouseY)
* if (mouseX != oldMouseX && mouseY != oldMouseY)
* {
* int cursorType;
* int newCursor1;
@ -1386,12 +1386,12 @@ void mainLoop(void) {
*
* cursorType = getCursorFromObject(mouseX, mouseY, &newCursor1, &newCursor2);
*
* if(cursorType == 9)
* if (cursorType == 9)
* {
* changeCursor(5);
* }
* else
* if(cursorType == -1)
* if (cursorType == -1)
* {
* changeCursor(6);
* }
@ -1422,10 +1422,10 @@ void mainLoop(void) {
// t_end = t_start+SPEED;
// t_left=t_start-Osystem_GetTicks()+SPEED;
#ifndef FASTDEBUG
/* if(t_left>0)
* if(t_left>SLEEP_MIN)
/* if (t_left>0)
* if (t_left>SLEEP_MIN)
* Osystem_Delay(t_left-SLEEP_GRAN);
* while(Osystem_GetTicks()<t_end){q++;}; */
* while (Osystem_GetTicks()<t_end){q++;}; */
#endif
manageEvents(4);

View file

@ -204,7 +204,7 @@ void loadCtpSub1(int boxIdx, int scale, uint16 *_walkboxTable,
var_E = 0;
si = &polyBuffer3[1];
/* if(*si>=0)
/* if (*si>=0)
* {
* di = si;
* cx = var_12;
@ -217,12 +217,12 @@ void loadCtpSub1(int boxIdx, int scale, uint16 *_walkboxTable,
* di++;
*
* var_2 = ax;
* if(var_C < bx)
* if (var_C < bx)
* {
* var_C = bx;
* }
*
* if(var_2 < var_A)
* if (var_2 < var_A)
* {
* var_A = var_2;
* }
@ -232,7 +232,7 @@ void loadCtpSub1(int boxIdx, int scale, uint16 *_walkboxTable,
* *cx = var_2;
* cx++;
* var_E ++;
* }while(di);
* }while (di);
*
* var_12 = cx;
* } */

View file

@ -709,14 +709,14 @@ int decompCompare(void) {
addDecomp("sign(%s)", param);
/*
if(!pop)
if (!pop)
si = 1;
if(pop<0) {
if (pop<0) {
si |= 4;
}
if(pop>0) {
if (pop>0) {
si |= 2;
}

View file

@ -863,7 +863,7 @@ int16 Op_SetColor(void) {
#define convertRatio 36.571428571428571428571428571429
for(i=startIdx; i<=endIdx; i++) {
for (i=startIdx; i<=endIdx; i++) {
R = (int)(colorR*convertRatio);
G = (int)(colorG*convertRatio);
B = (int)(colorB*convertRatio);

View file

@ -108,15 +108,15 @@ void gfxModuleData_field_60(char *sourcePtr, int width, int height,
* ax = y;
* si = 0;
*
* if(y>199) // out of screen vertically
* if (y>199) // out of screen vertically
* return;
*
* if(y<0) // cropped on the top
* if (y<0) // cropped on the top
* {
* cx = bx;
* bx -= ax;
* dx -= bx;
* if(dx <= 0)
* if (dx <= 0)
* {
* return;
* }
@ -130,12 +130,12 @@ void gfxModuleData_field_60(char *sourcePtr, int width, int height,
* ax += dx;
* ax--;
*
* if(ax > di)
* if (ax > di)
* {
* ax -= di;
* dx -= ax;
*
* if(dx <= 0)
* if (dx <= 0)
* {
* return;
* }
@ -170,7 +170,7 @@ void gfxModuleData_field_60(char *sourcePtr, int width, int height,
* dx = ax;
* ax = tempSwap;
*
* if(ax > di)
* if (ax > di)
* {
* return;
* }
@ -183,12 +183,12 @@ void gfxModuleData_field_60(char *sourcePtr, int width, int height,
*
* dx = dx&0xFF;
*
* if(cx<bx)
* if (cx<bx)
* {
* return;
* }
*
* if(cx>di)
* if (cx>di)
* {
* cx -= di;
* cx >>= 3;
@ -201,7 +201,7 @@ void gfxModuleData_field_60(char *sourcePtr, int width, int height,
* di = 0xF8F8;
* }
*
* if(ax<bx)
* if (ax<bx)
* {
* ax -= bx;
* ax = -ax;
@ -224,9 +224,9 @@ void gfxModuleData_field_60(char *sourcePtr, int width, int height,
*
* dx = loc_1064;
*
* if(dx)
* if (dx)
* {
* if(di&1)
* if (di&1)
* {
* loc_10C5++;
* }
@ -235,7 +235,7 @@ void gfxModuleData_field_60(char *sourcePtr, int width, int height,
* ax--;
* loc_11DC = ax;
*
* if(di&0x100)
* if (di&0x100)
* {
* bx--;
* }
@ -283,7 +283,7 @@ void gfxModuleData_field_60(char *sourcePtr, int width, int height,
* bx = dx;
* dx = 974;
*
* if(!bx) // no crop ?
* if (!bx) // no crop ?
* {
* do // for each line
* {
@ -299,12 +299,12 @@ void gfxModuleData_field_60(char *sourcePtr, int width, int height,
*
* siPtr+=4;
* diPtr++;
* }while(--cx);
* }while (--cx);
*
* diPtr += loc_1147; // interline
* siPtr += loc_114B;
* bp = bpSave;
* }while(--bp);
* }while (--bp);
* }
* else // croped
* {
@ -326,7 +326,7 @@ void gfxModuleData_field_60(char *sourcePtr, int width, int height,
* ax = bp;
* loc_12E1 = ax;
*
* if(loc_117C == 0xF8)
* if (loc_117C == 0xF8)
* {
* direction = 1;
* }
@ -335,7 +335,7 @@ void gfxModuleData_field_60(char *sourcePtr, int width, int height,
* direction = -1;
* }
*
* if(direction == -1)
* if (direction == -1)
* {
* goto label_11DC;
* }
@ -358,7 +358,7 @@ void gfxModuleData_field_60(char *sourcePtr, int width, int height,
* bx = (bx&0xFF00) | (ax&0xFF);
* ax = ((((((ax&0xFF00)>>8)&0xFF) | (ax&0xFF))<<8)&0xFF00) | (ax&0xFF);
*
* if(ax)
* if (ax)
* {
* bp = dx;
* ax = (ax&0xFF00) | (*diPtr)&0xFF;
@ -375,7 +375,7 @@ void gfxModuleData_field_60(char *sourcePtr, int width, int height,
* label_11DC:
*
* bp = loc_11DC;
* if(bp >0)
* if (bp >0)
* {
* do
* {
@ -413,7 +413,7 @@ void gfxModuleData_field_60(char *sourcePtr, int width, int height,
* ax = (ax&0xFF00) | ((ax&0xFF) | bx&0xFF);
* ax = (ax&0xFF00) | ((ax&0xFF)<<8) | (ax&0xFF);
*
* if(ax)
* if (ax)
* {
* cx = dx;
* ax = (ax&0xFF00) | (*diPtr)&0xFF;
@ -427,10 +427,10 @@ void gfxModuleData_field_60(char *sourcePtr, int width, int height,
*
* siPtr += 4;
* diPtr++;
* }while(--bp);
* }while (--bp);
* }
*
* if(loc_122B == 0xF8)
* if (loc_122B == 0xF8)
* {
* direction = 1;
* }
@ -439,7 +439,7 @@ void gfxModuleData_field_60(char *sourcePtr, int width, int height,
* direction = -1;
* }
*
* if(direction == -1)
* if (direction == -1)
* {
* goto label_12D9;
* }
@ -462,7 +462,7 @@ void gfxModuleData_field_60(char *sourcePtr, int width, int height,
* bx = (bx&0xFF00) | (ax&0xFF);
* ax = ((((((ax&0xFF00)>>8)&0xFF) | (ax&0xFF))<<8)&0xFF00) | (ax&0xFF);
*
* if(ax)
* if (ax)
* {
* bp = dx;
* ax = (ax&0xFF00) | (*diPtr)&0xFF;
@ -481,7 +481,7 @@ void gfxModuleData_field_60(char *sourcePtr, int width, int height,
* siPtr+=loc_12DD;
* bp = loc_12E1;
*
* }while(--bp);
* }while (--bp);
* } */
{
@ -526,9 +526,9 @@ void gfxModuleData_field_60(char *sourcePtr, int width, int height,
int i;
int j;
for(i=x;i<height+x;i++) {
for(j=y;j<width*16+y;j++) {
if(i>=0&&i<200&&j>=0&&j<320)
for (i=x;i<height+x;i++) {
for (j=y;j<width*16+y;j++) {
if (i>=0&&i<200&&j>=0&&j<320)
destPtr[i*320+j] = *(sourcePtr++);
}
}

View file

@ -930,7 +930,7 @@ void mainDraw(int16 param) {
if (newVal > currentObjPtr->animEnd) {
if (currentObjPtr->animLoop) {
newVal = currentObjPtr->animStart;
if(currentObjPtr->animLoop>0)
if (currentObjPtr->animLoop>0)
currentObjPtr->animLoop--;
} else {
int16 data2;
@ -950,7 +950,7 @@ void mainDraw(int16 param) {
}
} else {
ASSERT(0);
/* if(currentObjPtr->field_22>newVal)
/* if (currentObjPtr->field_22>newVal)
* {
* } */
}

View file

@ -221,7 +221,7 @@ int playerMenu(int menuX, int menuY) {
freeStuff2();
}
/*
if(currentMenu) {
if (currentMenu) {
freeMenu(currentMenu);
currentMenu = 0;
var37 = 0;
@ -229,7 +229,7 @@ int playerMenu(int menuX, int menuY) {
main9 = -1;
}
if(inventoryMenu) {
if (inventoryMenu) {
freeMenu(inventoryMenu);
inventoryMenu = 0;
var37 = 0;
@ -237,7 +237,7 @@ int playerMenu(int menuX, int menuY) {
main9 = -1;
}*/
/* if(mouseVar2) {
/* if (mouseVar2) {
free3(mouseVar2);
} */

View file

@ -40,11 +40,11 @@ void getMouseStatus(int16 *pMouseVar, int16 *pMouseX, int16 *pMouseButton,
*pMouseButton = 0;
/*
if(localStatus.left)
if (localStatus.left)
*pMouseButton |= 1;
if(localStatus.right)
if (localStatus.right)
*pMouseButton |= 2;
if(localStatus.middle)
if (localStatus.middle)
*pMouseButton |= 4;
*/
}

View file

@ -272,7 +272,7 @@ int loadOverlay(const uint8 *scriptName) {
if (!ovlData->data3Table) {
/* releaseScript(scriptIdx,scriptName);
if(freeIsNeeded) {
if (freeIsNeeded) {
freePtr(unpackedBuffer);
} */
@ -295,7 +295,7 @@ int loadOverlay(const uint8 *scriptName) {
if (!ptr) {
/* releaseScript(scriptIdx,scriptName);
*
* if(freeIsNeeded)
* if (freeIsNeeded)
* {
* freePtr(unpackedBuffer);
* } */
@ -344,7 +344,7 @@ int loadOverlay(const uint8 *scriptName) {
if (!ptr) {
/* releaseScript(scriptIdx,scriptName);
*
* if(freeIsNeeded)
* if (freeIsNeeded)
* {
* freePtr(unpackedBuffer);
* } */
@ -375,7 +375,7 @@ int loadOverlay(const uint8 *scriptName) {
if (!ovlData->ptr8) {
/* releaseScript(scriptIdx,scriptName);
if(freeIsNeeded) {
if (freeIsNeeded) {
freePtr(unpackedBuffer);
} */
@ -395,7 +395,7 @@ int loadOverlay(const uint8 *scriptName) {
if (!ovlData->objDataTable) {
/* releaseScript(scriptIdx,scriptName);
if(freeIsNeeded) {
if (freeIsNeeded) {
freePtr(unpackedBuffer);
} */
@ -455,7 +455,7 @@ int loadOverlay(const uint8 *scriptName) {
if (!ovlData->objData2WorkTable) {
/* releaseScript(scriptIdx,scriptName);
if(freeIsNeeded) {
if (freeIsNeeded) {
freePtr(unpackedBuffer);
} */
@ -471,7 +471,7 @@ int loadOverlay(const uint8 *scriptName) {
if (!ovlData->objData2SourceTable) {
/* releaseScript(scriptIdx,scriptName);
if(freeIsNeeded) {
if (freeIsNeeded) {
freePtr(unpackedBuffer);
} */
@ -497,7 +497,7 @@ int loadOverlay(const uint8 *scriptName) {
}
}
/* if(freeIsNeeded) {
/* if (freeIsNeeded) {
freePtr(unpackedBuffer);
} */
@ -571,7 +571,7 @@ int loadOverlay(const uint8 *scriptName) {
if (!ovlData->specialString1) {
/* releaseScript(scriptIdx,scriptName);
*
* if(freeIsNeeded)
* if (freeIsNeeded)
* {
* freePtr(unpackedBuffer);
* } */
@ -596,7 +596,7 @@ int loadOverlay(const uint8 *scriptName) {
if (!ovlData->specialString2) {
/* releaseScript(scriptIdx,scriptName);
*
* if(freeIsNeeded)
* if (freeIsNeeded)
* {
* freePtr(unpackedBuffer);
* } */
@ -622,7 +622,7 @@ int loadOverlay(const uint8 *scriptName) {
if (!ovlData->stringTable[i].string) {
/* releaseScript(scriptIdx,scriptName);
*
* if(freeIsNeeded)
* if (freeIsNeeded)
* {
* freePtr(unpackedBuffer);
* } */
@ -696,12 +696,12 @@ int releaseOverlay(const char *name) {
if (!ovlDataPtr)
return -4;
/*
if(overlayTable[overlayIdx].var1E) {
if (overlayTable[overlayIdx].var1E) {
free(overlayTable[overlayIdx].var1E);
overlayTable[overlayIdx].var1E = NULL;
}
if(overlayTable[overlayIdx].var16) {
if (overlayTable[overlayIdx].var16) {
free(overlayTable[overlayIdx].var16);
overlayTable[overlayIdx].var16 = NULL;
} */

View file

@ -183,7 +183,7 @@ void freeDisk(void) {
}
/* TODO
* if(PAL_fileHandle)
* if (PAL_fileHandle)
* {
* freeAllDataPtr();
* }

View file

@ -1281,7 +1281,7 @@ void Vmd::deDPCM(byte *soundBuf, byte *dataBuf, int16 &init, uint32 n) {
int32 s = init;
for (uint32 i = 0; i < n; i++) {
if(dataBuf[i] & 0x80)
if (dataBuf[i] & 0x80)
s -= _tableDPCM[dataBuf[i] & 0x7F];
else
s += _tableDPCM[dataBuf[i]];

View file

@ -735,7 +735,7 @@ bool Inter_v3::o3_getTotTextItemPart(OpFuncParams &params) {
_vm->_game->_totTextData->items[totTextItem].offset;
// Skip background rectangles
while(((int16) READ_LE_UINT16(totData)) != -1)
while (((int16) READ_LE_UINT16(totData)) != -1)
totData += 9;
totData += 2;

View file

@ -83,7 +83,7 @@ void KyraEngine_v2::seq_playSequences(int startSeq, int endSeq) {
_screen->loadBitmap(sequences[i].filename, 2, 2, _screen->_currentPalette);
_screen->updateScreen();
seqDelay = sequences[i].frameDelay * _tickLength;
} else if(sequences[i].type == 1) {
} else if (sequences[i].type == 1) {
seq_loadWSA(0, sequences[i].filename, sequences[i].frameDelay);
seqDelay = sequences[i].duration * _tickLength;
}
@ -410,7 +410,7 @@ void KyraEngine_v2::seq_introOverviewOver1(int currentFrame) {
if (currentFrame == 2)
seq_waitForChatsToFinish();
else if(currentFrame == 3)
else if (currentFrame == 3)
seq_playIntroChat(12);
}
@ -419,7 +419,7 @@ void KyraEngine_v2::seq_introOverviewForest(int currentFrame) {
if (currentFrame == 11) {
seq_waitForChatsToFinish();
} else if(currentFrame == 12) {
} else if (currentFrame == 12) {
delay(25);
seq_playIntroChat(2); // "...and tree by tree..."
}
@ -430,7 +430,7 @@ void KyraEngine_v2::seq_introOverviewDragon(int currentFrame) {
if (currentFrame == 3)
seq_playIntroChat(3); // "Kyrandia ceases to exist!"
else if(currentFrame == 11)
else if (currentFrame == 11)
seq_waitForChatsToFinish();
}

View file

@ -329,13 +329,13 @@ void QueenEngine::findGameStateDescriptions(char descriptions[100][32]) {
memset(marks, false, SAVESTATE_MAX_NUM * sizeof(bool)); //assume no savegames for this title
filenames = _saveFileMan->listSavefiles(prefix);
for(Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); file++){
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); file++){
//Obtain the last 2 digits of the filename, since they correspond to the save slot
slot[0] = file->c_str()[file->size()-2];
slot[1] = file->c_str()[file->size()-1];
slotNum = atoi(slot);
if(slotNum >= 0 && slotNum < SAVESTATE_MAX_NUM)
if (slotNum >= 0 && slotNum < SAVESTATE_MAX_NUM)
marks[slotNum] = true; //mark this slot as valid
}

View file

@ -533,7 +533,7 @@ void Actor::handleActions(int msec, bool setup) {
}
}
if(_vm->getGameType() == GType_ITE)
if (_vm->getGameType() == GType_ITE)
speed = (ACTOR_LMULT * 2 * actor->_screenScale + 63) / 256;
else
speed = (ACTOR_SPEED * actor->_screenScale + 128) >> 8;
@ -541,7 +541,7 @@ void Actor::handleActions(int msec, bool setup) {
if (speed < 1)
speed = 1;
if(_vm->getGameType() == GType_IHNM)
if (_vm->getGameType() == GType_IHNM)
speed = speed / 2;
if ((actor->_actionDirection == kDirUp) || (actor->_actionDirection == kDirDown)) {

View file

@ -128,13 +128,13 @@ void SagaEngine::fillSaveList() {
memset(_saveMarks, false, MAX_SAVES * sizeof(bool)); //assume no savegames for this title
filenames = _saveFileMan->listSavefiles(name);
for(Common::StringList::iterator file = filenames.begin(); file != filenames.end(); file++){
for (Common::StringList::iterator file = filenames.begin(); file != filenames.end(); file++){
//Obtain the last 2 digits of the filename, since they correspond to the save slot
slot[0] = file->c_str()[file->size()-2];
slot[1] = file->c_str()[file->size()-1];
slotNum = atoi(slot);
if(slotNum >= 0 && slotNum < MAX_SAVES)
if (slotNum >= 0 && slotNum < MAX_SAVES)
_saveMarks[slotNum] = true; //mark this slot as valid
}

View file

@ -397,13 +397,13 @@ void ScummEngine::listSavegames(bool *marks, int num) {
memset(marks, false, num * sizeof(bool)); //assume no savegames for this title
filenames = _saveFileMan->listSavefiles(prefix);
for(Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); file++){
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); file++){
//Obtain the last 2 digits of the filename, since they correspond to the save slot
slot[0] = file->c_str()[file->size()-2];
slot[1] = file->c_str()[file->size()-1];
slotNum = atoi(slot);
if(slotNum >= 0 && slotNum < num)
if (slotNum >= 0 && slotNum < num)
marks[slotNum] = true; //mark this slot as valid
}
}

View file

@ -947,7 +947,7 @@ void ScummEngine_v5::loadVars() {
if (a == STRINGID_IQ_SERIES && b == STRINGID_IQ_SERIES) {
// Zak256 loads the IQ script-slot but does not use it -> ignore it
if(_game.id == GID_INDY3) {
if (_game.id == GID_INDY3) {
loadIQPoints();
}
break;
@ -968,7 +968,7 @@ void ScummEngine_v5::loadVars() {
if (!ptr[pos])
break;
// replace special characters
if(ptr[pos] >= 32 && ptr[pos] <= 122 && ptr[pos] != 64)
if (ptr[pos] >= 32 && ptr[pos] <= 122 && ptr[pos] != 64)
slotContent[pos] = ptr[pos];
else
slotContent[pos] = '_';

View file

@ -564,7 +564,7 @@ void ScummEngine::checkExecVerbs() {
// like F5 (=0x8005) or joystick buttons (mask 0xFE00, e.g. SELECT=0xFE40 for the save/load menu).
// Hence the distinction with (_mouseAndKeyboardStat < MBS_MAX_KEY) between mouse- and key-events is not applicable
// to this games, so we have to remap the special keys here.
if(_mouseAndKeyboardStat == 319) {
if (_mouseAndKeyboardStat == 319) {
_mouseAndKeyboardStat = 0x8005;
}
}

View file

@ -2358,7 +2358,7 @@ void ToucheEngine::removeConversationChoice(int16 num) {
for (int i = 0; i < NUM_CONVERSATION_CHOICES; ++i) {
if (_conversationChoicesTable[i].num == num) {
_conversationChoicesUpdated = true;
for(; i < NUM_CONVERSATION_CHOICES - 1; ++i) {
for (; i < NUM_CONVERSATION_CHOICES - 1; ++i) {
_conversationChoicesTable[i].num = _conversationChoicesTable[i + 1].num;
_conversationChoicesTable[i].msg = _conversationChoicesTable[i + 1].msg;
}

View file

@ -381,19 +381,19 @@ void ToucheEngine::handleOptions(int forceDisplay) {
memset(menuData.saveLoadMarks, false, 100 * sizeof(bool)); //assume no savegames for this title
filenames = _saveFileMan->listSavefiles(gameStateFileName);
for(Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); file++){
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); file++){
//Obtain the last 1 or 2 digits of the filename, since they correspond to the save slot
//This engine can save games either with one or two digits, hence the additional if statement
slot[0] = file->c_str()[file->size()-2];
slot[1] = file->c_str()[file->size()-1];
if(!atoi(&slot[0])){
if (!atoi(&slot[0])){
slotNum = atoi(&slot[1]);
} else {
slotNum = atoi(slot);
}
if(slotNum >= 0 && slotNum < 100)
if (slotNum >= 0 && slotNum < 100)
menuData.saveLoadMarks[slotNum] = true; //mark this slot as valid
}

View file

@ -814,7 +814,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
if (browser.runModal() > 0) {
// User made his choice...
FilesystemNode dir(browser.getResult());
if(dir.isWritable()) {
if (dir.isWritable()) {
_savePath->setLabel(dir.getPath());
} else {
MessageDialog error("The chosen directory cannot be written to. Please select another one.");

View file

@ -64,7 +64,7 @@ void processMainLists(FILE *inf, CptObj *destArr, uint16 *idList) {
memcpy(dest->data, resBuf, resPos * 2);
} else
break;
} while(1);
} while (1);
free(resBuf);
}
@ -116,7 +116,7 @@ void processCpts(FILE *inf, CptObj *destArr) {
memcpy(dest->data, resBuf, resPos * 2);
} else
break;
} while(1);
} while (1);
free(resBuf);
}
@ -158,7 +158,7 @@ void processTurntabs(FILE *inf, CptObj *destArr) {
memcpy(dest->data, resBuf, resPos * 2);
} else
break;
} while(1);
} while (1);
free(resBuf);
}
@ -200,7 +200,7 @@ void processBins(FILE *inf, CptObj *destArr, char *typeName, char *objName, uint
memcpy(dest->data, resBuf, resPos * 2);
} else
break;
} while(1);
} while (1);
free(resBuf);
}
@ -239,7 +239,7 @@ void processSymlinks(FILE *inf, CptObj *destArr, uint16 *baseLists) {
assert(isEndOfObject(line, "SYMLINK", fromId));
} else
break;
} while(1);
} while (1);
}
void doCompile(FILE *inf, FILE *debOutf, FILE *resOutf, TextFile *cptDef, FILE *sve) {