Commit 52bcf76e authored by Gerhard Stein's avatar Gerhard Stein

Some improvements for embedded systems

parent 8e5d6ad8
......@@ -100,10 +100,11 @@ bool CAudioGalaxy::LoadFromAudioCK(const CExeFile& ExeFile)
// Open the AUDIOHED so we know where to decompress
uint32_t number_of_audiorecs = 0;
// That size must appear as integer in the ExeFile. Look for it!
#if defined(ANDROID)
/*#if defined(ANDROID)
assert( reinterpret_cast<size_t>(ExeFile.getHeaderData()) % 4 == 0 ); // Make sure the pointer is aligned, or we'll get segfault on Android
#endif
uint32_t *audiohedptr = (uint32_t*) (void*) ExeFile.getHeaderData();
#endif*/
//uint32_t *audiohedptr = reinterpret_cast(uint32_t*) (void*) ExeFile.getHeaderData();
uint32_t *audiohedptr = reinterpret_cast<uint32_t*>(ExeFile.getHeaderData());
bool found = false;
for( const uint32_t *endptr = (uint32_t*) (void*) ExeFile.getHeaderData() + ExeFile.getExeDataSize()/sizeof(uint32_t);
audiohedptr < endptr ;
......@@ -161,11 +162,13 @@ bool CAudioGalaxy::LoadFromAudioCK(const CExeFile& ExeFile)
if( audio_start < audio_end )
{
#if defined(ANDROID)
/*#if defined(ANDROID)
assert( AudioCompFileData + audio_start % 4 == 0 ); // Make sure the pointer is aligned, or we'll get segfault on Android
#endif
#endif*/
const uint32_t audio_comp_data_start = audio_start+sizeof(uint32_t);
const uint32_t *AudioCompFileData32 = (uint32_t*) (void*) (AudioCompFileData + audio_start);
//const uint32_t *AudioCompFileData32 = (uint32_t*) (void*) (AudioCompFileData + audio_start);
const uint32_t *AudioCompFileData32 = reinterpret_cast<uint32_t*>(AudioCompFileData + audio_start);
outsize = *AudioCompFileData32;
byte imfdata[outsize];
......
/*
* Configurator.h
*
* Created on: 17.06.2012
* Author: gerstrong
*
* This header file helps to set Makro Definitions for proper devices.
* Please put your configurations in here if you want to specialize your version of CG.
* For example Android devices should not have Multiplayer modus and be able to change resolution.
*/
#ifndef CONFIGURATOR_H_
#define CONFIGURATOR_H_
#if defined(ANDROID)
#define EMBEDDED
#endif
#if defined(EMBEDDED)
#define SINGLEPLAYER
#endif
#endif /* CONFIGURATOR_H_ */
......@@ -40,9 +40,6 @@ void CVidConfig::reset()
#else
m_DisplayRect.w=320;
m_DisplayRect.h=200;
#if defined(ANDROID)
//m_Resolution.=16;
#endif
Fullscreen=false;
#endif
m_ScaleXFilter=1;
......
......@@ -91,7 +91,7 @@ void CVideoDriver::initResolutionList()
#endif
// Now on non-handheld devices let's check for more resolutions.
#if !defined(TARGET_OS_IPHONE) && !defined(TARGET_IPHONE_SIMULATOR) && !defined(ANDROID)
#if !defined(EMBEDDED)
for( unsigned int c=0 ; c<NUM_MAIN_RESOLUTIONS ; c++ )
{
// Depth won't be read anymore! Take the one the system is using actually
......@@ -200,7 +200,7 @@ bool CVideoDriver::applyMode()
while(((Res.w/GameRect.w) < m_VidConfig.Zoom || (Res.h/GameRect.h) < m_VidConfig.Zoom) && (m_VidConfig.Zoom > 1))
m_VidConfig.Zoom--;
#if defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR) || defined(ANDROID)
#if defined(EMBEDDED)
// Force the default settings on iPhone.
// There is no reason yet to play with it, most likely other settings will
// either not work, will crash or will just be totally screwed up.
......
......@@ -108,11 +108,12 @@ bool CIMFPlayer::readCompressedAudiointoMemory(const CExeFile& ExeFile,
// Open the AUDIOHED so we know where tomp_IMF_Data decompress
uint32_t number_of_audiorecs = 0;
// That size must appear as integer in the ExeFile. Look for it!
#if defined(ANDROID)
/*#if defined(ANDROID)
assert( reinterpret_cast<size_t>(ExeFile.getHeaderData()) % 4 == 0 ); // Make sure the pointer is aligned, or we'll get segfault on Android
#endif
#endif*/
// TODO: Not sure, if that is a good idea
audiohedptr = (uint32_t*) (void*) ExeFile.getHeaderData();
//audiohedptr = (uint32_t*) (void*) ExeFile.getHeaderData();
audiohedptr = reinterpret_cast<uint32_t*>(ExeFile.getHeaderData());
bool found = false;
for( const uint32_t *endptr = (uint32_t*) (void*) ExeFile.getHeaderData()+ExeFile.getExeDataSize()/sizeof(uint32_t);
audiohedptr < endptr ;
......@@ -174,11 +175,12 @@ bool CIMFPlayer::unpackAudioAt( const CExeFile& ExeFile,
if( audio_start < audio_end )
{
#if defined(ANDROID)
/*#if defined(ANDROID)
assert( AudioCompFileData + audio_start % 4 == 0 ); // Make sure the pointer is aligned, or we'll get segfault on Android
#endif
#endif*/
const uint32_t audio_comp_data_start = audio_start+sizeof(uint32_t);
const uint32_t *AudioCompFileData32 = (uint32_t*) (void*) (AudioCompFileData + audio_start);
//const uint32_t *AudioCompFileData32 = (uint32_t*) (void*) (AudioCompFileData + audio_start);
const uint32_t *AudioCompFileData32 = reinterpret_cast<uint32_t*>(AudioCompFileData + audio_start);
const uint32_t emb_file_data_size = *AudioCompFileData32;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment