[Scummvm-git-logs] scummvm master -> 9c8eb3ddbf4192f9b6d47b0c28c4fc10384f3ff7
dreammaster
paulfgilbert at gmail.com
Sat Feb 8 22:13:03 UTC 2020
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
fc76525d44 ULTIMA8: Added splash screen to recognise Pentagram
9c8eb3ddbf ULTIMA8: Remove Pentagram sub-namespace
Commit: fc76525d4448d0c5b88c093d061684944daac380
https://github.com/scummvm/scummvm/commit/fc76525d4448d0c5b88c093d061684944daac380
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-02-08T14:12:49-08:00
Commit Message:
ULTIMA8: Added splash screen to recognise Pentagram
Changed paths:
dists/engine-data/ultima.dat
engines/ultima/ultima8/games/u8_game.cpp
engines/ultima/ultima8/games/u8_game.h
engines/ultima/ultima8/graphics/base_soft_render_surface.h
engines/ultima/ultima8/graphics/render_surface.h
engines/ultima/ultima8/ultima8.cpp
engines/ultima/ultima8/ultima8.h
diff --git a/dists/engine-data/ultima.dat b/dists/engine-data/ultima.dat
index 40c7ae5..0fa6c99 100644
Binary files a/dists/engine-data/ultima.dat and b/dists/engine-data/ultima.dat differ
diff --git a/engines/ultima/ultima8/games/u8_game.cpp b/engines/ultima/ultima8/games/u8_game.cpp
index fc37b7a..e0d861d 100644
--- a/engines/ultima/ultima8/games/u8_game.cpp
+++ b/engines/ultima/ultima8/games/u8_game.cpp
@@ -474,7 +474,6 @@ void U8Game::writeSaveInfo(ODataSource *ods) {
}
}
-
Std::string U8Game::getCreditText(IDataSource *ids) {
Std::string text;
unsigned int size = ids->getSize();
diff --git a/engines/ultima/ultima8/games/u8_game.h b/engines/ultima/ultima8/games/u8_game.h
index 4a36469..7eddbe6 100644
--- a/engines/ultima/ultima8/games/u8_game.h
+++ b/engines/ultima/ultima8/games/u8_game.h
@@ -51,7 +51,6 @@ public:
static void ConCmd_cheatItems(const Console::ArgvType &argv);
static void ConCmd_cheatEquip(const Console::ArgvType &argv);
-
protected:
Std::string getCreditText(IDataSource *ids);
};
diff --git a/engines/ultima/ultima8/graphics/base_soft_render_surface.h b/engines/ultima/ultima8/graphics/base_soft_render_surface.h
index c610ed5..ce3c40a 100644
--- a/engines/ultima/ultima8/graphics/base_soft_render_surface.h
+++ b/engines/ultima/ultima8/graphics/base_soft_render_surface.h
@@ -110,14 +110,14 @@ public:
// Begin painting to the buffer. MUST BE CALLED BEFORE DOING ANYTHING TO THE SURFACE!
// Can be called multiple times
// Returns Error Code on error. Check return code.....
- virtual ECode BeginPainting();
+ virtual ECode BeginPainting() override;
// Finish paining to the buffer. MUST BE CALLED FOR EACH CALL TO BeginPainting()
// Returns Error Code on error. Check return code.....
- virtual ECode EndPainting();
+ virtual ECode EndPainting() override;
// Get the surface as a Texture. Only valid for SecondaryRenderSurfaces
- virtual Texture *GetSurfaceAsTexture();
+ virtual Texture *GetSurfaceAsTexture() override;
//
@@ -128,25 +128,25 @@ public:
virtual void SetOrigin(int32 x, int32 y);
// Set the Origin of the Surface
- virtual void GetOrigin(int32 &x, int32 &y) const;
+ virtual void GetOrigin(int32 &x, int32 &y) const override;
// Get the Surface Dimensions
- virtual void GetSurfaceDims(Pentagram::Rect &) const;
+ virtual void GetSurfaceDims(Pentagram::Rect &) const override;
// Get Clipping Rectangle
- virtual void GetClippingRect(Pentagram::Rect &) const;
+ virtual void GetClippingRect(Pentagram::Rect &) const override;
// Set Clipping Rectangle
virtual void SetClippingRect(const Pentagram::Rect &);
// Check Clipped. -1 if off screen, 0 if not clipped, 1 if clipped
- virtual int16 CheckClipped(const Pentagram::Rect &) const;
+ virtual int16 CheckClipped(const Pentagram::Rect &) const override;
// Flip the surface
- virtual void SetFlipped(bool flipped);
+ virtual void SetFlipped(bool flipped) override;
// Has the render surface been flipped?
- virtual bool IsFlipped() const;
+ virtual bool IsFlipped() const override;
//
// Surface Palettes
@@ -166,6 +166,9 @@ public:
virtual void CreateNativePalette(Pentagram::Palette *palette);
+ Graphics::ManagedSurface *getRawSurface() const override {
+ return sdl_surf;
+ }
};
} // End of namespace Ultima8
diff --git a/engines/ultima/ultima8/graphics/render_surface.h b/engines/ultima/ultima8/graphics/render_surface.h
index 1d5949b..74ad68f 100644
--- a/engines/ultima/ultima8/graphics/render_surface.h
+++ b/engines/ultima/ultima8/graphics/render_surface.h
@@ -25,6 +25,7 @@
#include "ultima/ultima8/graphics/graphics_errors.h"
#include "graphics/pixelformat.h"
+#include "graphics/managed_surface.h"
namespace Ultima {
namespace Ultima8 {
@@ -132,6 +133,8 @@ public:
//! Has the render surface been flipped?
virtual bool IsFlipped() const = 0;
+ //! Get a reference to the underlying surface that's being encapsulated
+ virtual Graphics::ManagedSurface *getRawSurface() const = 0;
//
// Surface Palettes
diff --git a/engines/ultima/ultima8/ultima8.cpp b/engines/ultima/ultima8/ultima8.cpp
index 85be648..6f5fb73 100644
--- a/engines/ultima/ultima8/ultima8.cpp
+++ b/engines/ultima/ultima8/ultima8.cpp
@@ -24,7 +24,9 @@
#include "common/translation.h"
#include "common/unzip.h"
#include "common/translation.h"
+#include "common/config-manager.h"
#include "gui/saveload.h"
+#include "image/png.h"
#include "ultima/shared/engine/events.h"
#include "ultima/ultima8/ultima8.h"
@@ -981,6 +983,11 @@ void Ultima8Engine::GraphicSysInit() {
screen = new_screen;
+ // Show the splash screen immediately now that the screen has been set up
+ int saveSlot = ConfMan.hasKey("save_slot") ? ConfMan.getInt("save_slot") : -1;
+ if (saveSlot == -1)
+ showSplashScreen();
+
bool ttf_antialiasing = true;
settingman->setDefault("ttf_antialiasing", true);
settingman->get("ttf_antialiasing", ttf_antialiasing);
@@ -2047,5 +2054,31 @@ bool Ultima8Engine::isDataRequired(Common::String &folder, int &majorVersion, in
return true;
}
+Graphics::Screen *Ultima8Engine::getScreen() const {
+ Graphics::Screen *scr = dynamic_cast<Graphics::Screen *>(screen->getRawSurface());
+ assert(scr);
+ return scr;
+}
+
+void Ultima8Engine::showSplashScreen() {
+ Image::PNGDecoder png;
+ Common::File f;
+
+ // Get splash screen image
+ if (!f.open("data/pentagram.png") || !png.loadStream(f))
+ return;
+
+ // Blit the splash image to the screen
+ Graphics::Screen *scr = Ultima8Engine::get_instance()->getScreen();
+ const Graphics::Surface *srcSurface = png.getSurface();
+
+ scr->transBlitFrom(*srcSurface, Common::Rect(0, 0, srcSurface->w, srcSurface->h),
+ Common::Rect(0, 0, scr->w, scr->h));
+ scr->update();
+
+ // Pause to allow the image to be seen
+ g_system->delayMillis(2000);
+}
+
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/ultima8.h b/engines/ultima/ultima8/ultima8.h
index 2a2e65f..a10d4cd 100644
--- a/engines/ultima/ultima8/ultima8.h
+++ b/engines/ultima/ultima8/ultima8.h
@@ -86,6 +86,11 @@ private:
*/
void deinitialize() override;
+ /**
+ * Shows the Pentagram splash screen
+ */
+ void showSplashScreen();
+
// Load and save games from arbitrary filenames from the console
static void ConCmd_saveGame(const Console::ArgvType &argv); //!< "Ultima8Engine::saveGame <optional filename>" console command
static void ConCmd_loadGame(const Console::ArgvType &argv); //!< "Ultima8Engine::loadGame <optional filename>" console command
@@ -245,6 +250,8 @@ public:
return screen;
}
+ virtual Graphics::Screen *getScreen() const override;
+
virtual void runGame() override;
virtual void handleEvent(const Common::Event &event);
Commit: 9c8eb3ddbf4192f9b6d47b0c28c4fc10384f3ff7
https://github.com/scummvm/scummvm/commit/9c8eb3ddbf4192f9b6d47b0c28c4fc10384f3ff7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-02-08T14:12:49-08:00
Commit Message:
ULTIMA8: Remove Pentagram sub-namespace
Changed paths:
engines/ultima/ultima8/audio/audio_channel.cpp
engines/ultima/ultima8/audio/audio_channel.h
engines/ultima/ultima8/audio/audio_mixer.cpp
engines/ultima/ultima8/audio/audio_mixer.h
engines/ultima/ultima8/audio/audio_process.cpp
engines/ultima/ultima8/audio/audio_process.h
engines/ultima/ultima8/audio/audio_sample.cpp
engines/ultima/ultima8/audio/audio_sample.h
engines/ultima/ultima8/audio/music_flex.cpp
engines/ultima/ultima8/audio/music_flex.h
engines/ultima/ultima8/audio/music_process.cpp
engines/ultima/ultima8/audio/raw_audio_sample.cpp
engines/ultima/ultima8/audio/raw_audio_sample.h
engines/ultima/ultima8/audio/sonarc_audio_sample.cpp
engines/ultima/ultima8/audio/sonarc_audio_sample.h
engines/ultima/ultima8/audio/sound_flex.cpp
engines/ultima/ultima8/audio/sound_flex.h
engines/ultima/ultima8/audio/speech_flex.cpp
engines/ultima/ultima8/audio/speech_flex.h
engines/ultima/ultima8/conf/config_file_manager.cpp
engines/ultima/ultima8/conf/config_file_manager.h
engines/ultima/ultima8/conf/ini_file.cpp
engines/ultima/ultima8/conf/ini_file.h
engines/ultima/ultima8/conf/setting_manager.cpp
engines/ultima/ultima8/conf/setting_manager.h
engines/ultima/ultima8/filesys/archive.cpp
engines/ultima/ultima8/filesys/archive.h
engines/ultima/ultima8/filesys/raw_archive.cpp
engines/ultima/ultima8/filesys/raw_archive.h
engines/ultima/ultima8/games/game_data.cpp
engines/ultima/ultima8/games/game_detector.cpp
engines/ultima/ultima8/games/game_info.cpp
engines/ultima/ultima8/games/game_info.h
engines/ultima/ultima8/games/game_md5.h
engines/ultima/ultima8/games/treasure_loader.cpp
engines/ultima/ultima8/games/treasure_loader.h
engines/ultima/ultima8/graphics/base_soft_render_surface.cpp
engines/ultima/ultima8/graphics/base_soft_render_surface.h
engines/ultima/ultima8/graphics/fonts/font.cpp
engines/ultima/ultima8/graphics/fonts/font.h
engines/ultima/ultima8/graphics/fonts/font_manager.cpp
engines/ultima/ultima8/graphics/fonts/font_manager.h
engines/ultima/ultima8/graphics/fonts/font_shape_archive.cpp
engines/ultima/ultima8/graphics/fonts/font_shape_archive.h
engines/ultima/ultima8/graphics/fonts/jp_font.cpp
engines/ultima/ultima8/graphics/fonts/jp_font.h
engines/ultima/ultima8/graphics/fonts/jp_rendered_text.cpp
engines/ultima/ultima8/graphics/fonts/shape_font.cpp
engines/ultima/ultima8/graphics/fonts/shape_font.h
engines/ultima/ultima8/graphics/fonts/tt_font.cpp
engines/ultima/ultima8/graphics/fonts/tt_font.h
engines/ultima/ultima8/graphics/gump_shape_archive.cpp
engines/ultima/ultima8/graphics/gump_shape_archive.h
engines/ultima/ultima8/graphics/main_shape_archive.h
engines/ultima/ultima8/graphics/palette.cpp
engines/ultima/ultima8/graphics/palette.h
engines/ultima/ultima8/graphics/palette_fader_process.cpp
engines/ultima/ultima8/graphics/palette_fader_process.h
engines/ultima/ultima8/graphics/palette_manager.cpp
engines/ultima/ultima8/graphics/palette_manager.h
engines/ultima/ultima8/graphics/point_scaler.cpp
engines/ultima/ultima8/graphics/point_scaler.h
engines/ultima/ultima8/graphics/render_surface.h
engines/ultima/ultima8/graphics/scaler.h
engines/ultima/ultima8/graphics/shape.h
engines/ultima/ultima8/graphics/shape_archive.cpp
engines/ultima/ultima8/graphics/shape_archive.h
engines/ultima/ultima8/graphics/skf_player.cpp
engines/ultima/ultima8/graphics/skf_player.h
engines/ultima/ultima8/graphics/soft_render_surface.cpp
engines/ultima/ultima8/graphics/soft_render_surface.h
engines/ultima/ultima8/graphics/type_flags.cpp
engines/ultima/ultima8/gumps/ask_gump.cpp
engines/ultima/ultima8/gumps/bark_gump.cpp
engines/ultima/ultima8/gumps/bind_gump.cpp
engines/ultima/ultima8/gumps/bind_gump.h
engines/ultima/ultima8/gumps/console_gump.cpp
engines/ultima/ultima8/gumps/container_gump.h
engines/ultima/ultima8/gumps/controls_gump.cpp
engines/ultima/ultima8/gumps/credits_gump.cpp
engines/ultima/ultima8/gumps/desktop_gump.cpp
engines/ultima/ultima8/gumps/game_map_gump.cpp
engines/ultima/ultima8/gumps/gump.cpp
engines/ultima/ultima8/gumps/gump.h
engines/ultima/ultima8/gumps/item_relative_gump.cpp
engines/ultima/ultima8/gumps/menu_gump.cpp
engines/ultima/ultima8/gumps/message_box_gump.cpp
engines/ultima/ultima8/gumps/minimap_gump.cpp
engines/ultima/ultima8/gumps/paperdoll_gump.cpp
engines/ultima/ultima8/gumps/paperdoll_gump.h
engines/ultima/ultima8/gumps/pentagram_menu_gump.cpp
engines/ultima/ultima8/gumps/readable_gump.cpp
engines/ultima/ultima8/gumps/scaler_gump.cpp
engines/ultima/ultima8/gumps/scaler_gump.h
engines/ultima/ultima8/gumps/shape_viewer_gump.cpp
engines/ultima/ultima8/gumps/slider_gump.cpp
engines/ultima/ultima8/gumps/u8_save_gump.cpp
engines/ultima/ultima8/gumps/widgets/edit_widget.cpp
engines/ultima/ultima8/gumps/widgets/edit_widget.h
engines/ultima/ultima8/gumps/widgets/game_widget.cpp
engines/ultima/ultima8/gumps/widgets/game_widget.h
engines/ultima/ultima8/gumps/widgets/text_widget.cpp
engines/ultima/ultima8/gumps/widgets/text_widget.h
engines/ultima/ultima8/kernel/core_app.cpp
engines/ultima/ultima8/kernel/core_app.h
engines/ultima/ultima8/kernel/hid_keys.cpp
engines/ultima/ultima8/kernel/hid_keys.h
engines/ultima/ultima8/kernel/hid_manager.cpp
engines/ultima/ultima8/kernel/hid_manager.h
engines/ultima/ultima8/kernel/memory_manager.cpp
engines/ultima/ultima8/kernel/mouse.cpp
engines/ultima/ultima8/misc/box.h
engines/ultima/ultima8/misc/console.cpp
engines/ultima/ultima8/misc/console.h
engines/ultima/ultima8/misc/encoding.cpp
engines/ultima/ultima8/misc/encoding.h
engines/ultima/ultima8/misc/istring.cpp
engines/ultima/ultima8/misc/istring.h
engines/ultima/ultima8/misc/md5.cpp
engines/ultima/ultima8/misc/md5.h
engines/ultima/ultima8/misc/memset_n.h
engines/ultima/ultima8/misc/pent_include.cpp
engines/ultima/ultima8/misc/pent_include.h
engines/ultima/ultima8/misc/rect.h
engines/ultima/ultima8/misc/util.cpp
engines/ultima/ultima8/misc/util.h
engines/ultima/ultima8/ultima8.cpp
engines/ultima/ultima8/ultima8.h
engines/ultima/ultima8/world/actors/animation_tracker.cpp
engines/ultima/ultima8/world/actors/main_actor.cpp
engines/ultima/ultima8/world/actors/pathfinder.cpp
engines/ultima/ultima8/world/current_map.cpp
engines/ultima/ultima8/world/item.cpp
engines/ultima/ultima8/world/item.h
engines/ultima/ultima8/world/item_sorter.cpp
diff --git a/engines/ultima/ultima8/audio/audio_channel.cpp b/engines/ultima/ultima8/audio/audio_channel.cpp
index f2dff37..35d0154 100644
--- a/engines/ultima/ultima8/audio/audio_channel.cpp
+++ b/engines/ultima/ultima8/audio/audio_channel.cpp
@@ -29,7 +29,6 @@
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
// We divide the data by 2, to prevent overshots. Imagine this _sample pattern:
// 0, 65535, 65535, 0. Now you want to compute a value between the two 65535.
@@ -125,6 +124,5 @@ void AudioChannel::decompressNextFrame() {
(void)_sample->decompressFrame(playData, src2);
}
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/audio/audio_channel.h b/engines/ultima/ultima8/audio/audio_channel.h
index c881081..eb7d9ea 100644
--- a/engines/ultima/ultima8/audio/audio_channel.h
+++ b/engines/ultima/ultima8/audio/audio_channel.h
@@ -27,7 +27,6 @@
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
class AudioSample;
@@ -105,7 +104,6 @@ public:
}
};
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/audio/audio_mixer.cpp b/engines/ultima/ultima8/audio/audio_mixer.cpp
index 4bafa75..382392c 100644
--- a/engines/ultima/ultima8/audio/audio_mixer.cpp
+++ b/engines/ultima/ultima8/audio/audio_mixer.cpp
@@ -32,7 +32,6 @@
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
AudioMixer *AudioMixer::the_audio_mixer = 0;
@@ -185,6 +184,5 @@ void AudioMixer::closeMidiOutput() {
_midiPlayer = nullptr;
}
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/audio/audio_mixer.h b/engines/ultima/ultima8/audio/audio_mixer.h
index f1563d1..3012a30 100644
--- a/engines/ultima/ultima8/audio/audio_mixer.h
+++ b/engines/ultima/ultima8/audio/audio_mixer.h
@@ -34,8 +34,6 @@ namespace Ultima8 {
#define CHANNEL_COUNT 8
class MidiPlayer;
-
-namespace Pentagram {
class AudioChannel;
class AudioSample;
@@ -77,7 +75,6 @@ public:
void closeMidiOutput();
};
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/audio/audio_process.cpp b/engines/ultima/ultima8/audio/audio_process.cpp
index 979c31f..f648047 100644
--- a/engines/ultima/ultima8/audio/audio_process.cpp
+++ b/engines/ultima/ultima8/audio/audio_process.cpp
@@ -39,9 +39,6 @@
namespace Ultima {
namespace Ultima8 {
-using Pentagram::AudioSample;
-using Pentagram::AudioMixer;
-
// p_dynamic_class stuff
DEFINE_RUNTIME_CLASSTYPE_CODE(AudioProcess, Process)
diff --git a/engines/ultima/ultima8/audio/audio_process.h b/engines/ultima/ultima8/audio/audio_process.h
index 5e8ac2e..8784d58 100644
--- a/engines/ultima/ultima8/audio/audio_process.h
+++ b/engines/ultima/ultima8/audio/audio_process.h
@@ -31,9 +31,8 @@
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
+
class AudioSample;
-}
class AudioProcess :
public Process {
@@ -112,7 +111,7 @@ public:
//! play a sample (without storing a SampleInfo)
//! returns channel sample is played on, or -1
- int playSample(Pentagram::AudioSample *sample, int priority, int loops,
+ int playSample(AudioSample *sample, int priority, int loops,
uint32 pitch_shift = 0x10000, int16 lvol = 256, int16 rvol = 256);
//! pause all currently playing samples
diff --git a/engines/ultima/ultima8/audio/audio_sample.cpp b/engines/ultima/ultima8/audio/audio_sample.cpp
index bbe3ce9..7d9dba8 100644
--- a/engines/ultima/ultima8/audio/audio_sample.cpp
+++ b/engines/ultima/ultima8/audio/audio_sample.cpp
@@ -25,7 +25,6 @@
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
AudioSample::AudioSample(uint8 *buffer_, uint32 size_) :
sample_rate(0), bits(0), stereo(false),
@@ -37,6 +36,5 @@ AudioSample::~AudioSample(void) {
delete [] buffer;
}
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/audio/audio_sample.h b/engines/ultima/ultima8/audio/audio_sample.h
index 0f16313..c8d32de 100644
--- a/engines/ultima/ultima8/audio/audio_sample.h
+++ b/engines/ultima/ultima8/audio/audio_sample.h
@@ -28,8 +28,6 @@ namespace Ultima8 {
class IDataSource;
-namespace Pentagram {
-
class AudioSample {
protected:
uint32 sample_rate;
@@ -72,7 +70,6 @@ public:
virtual void rewind(void *DecompData) const = 0;
};
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/audio/music_flex.cpp b/engines/ultima/ultima8/audio/music_flex.cpp
index e150242..9a1e77d 100644
--- a/engines/ultima/ultima8/audio/music_flex.cpp
+++ b/engines/ultima/ultima8/audio/music_flex.cpp
@@ -28,7 +28,7 @@
namespace Ultima {
namespace Ultima8 {
-DEFINE_RUNTIME_CLASSTYPE_CODE(MusicFlex, Pentagram::Archive)
+DEFINE_RUNTIME_CLASSTYPE_CODE(MusicFlex, Archive)
MusicFlex::MusicFlex(IDataSource *ds) : Archive(ds) {
diff --git a/engines/ultima/ultima8/audio/music_flex.h b/engines/ultima/ultima8/audio/music_flex.h
index 2e18396..2f7fcab 100644
--- a/engines/ultima/ultima8/audio/music_flex.h
+++ b/engines/ultima/ultima8/audio/music_flex.h
@@ -31,7 +31,7 @@ namespace Ultima8 {
class XMidiFile;
-class MusicFlex : public Pentagram::Archive {
+class MusicFlex : public Archive {
public:
ENABLE_RUNTIME_CLASSTYPE()
@@ -69,7 +69,7 @@ public:
virtual bool isCached(uint32 index) override;
uint8 *getRawObject(uint32 index, uint32 *sizep = 0) {
- return Pentagram::Archive::getRawObject(index, sizep);
+ return Archive::getRawObject(index, sizep);
}
private:
diff --git a/engines/ultima/ultima8/audio/music_process.cpp b/engines/ultima/ultima8/audio/music_process.cpp
index 7a89a43..6c82df9 100644
--- a/engines/ultima/ultima8/audio/music_process.cpp
+++ b/engines/ultima/ultima8/audio/music_process.cpp
@@ -245,7 +245,7 @@ bool MusicProcess::loadData(IDataSource *ids, uint32 version) {
the_music_process = this;
- _midiPlayer = Pentagram::AudioMixer::get_instance()->getMidiPlayer();
+ _midiPlayer = AudioMixer::get_instance()->getMidiPlayer();
return true;
}
diff --git a/engines/ultima/ultima8/audio/raw_audio_sample.cpp b/engines/ultima/ultima8/audio/raw_audio_sample.cpp
index 1714eaa..dd5d822 100644
--- a/engines/ultima/ultima8/audio/raw_audio_sample.cpp
+++ b/engines/ultima/ultima8/audio/raw_audio_sample.cpp
@@ -26,7 +26,6 @@
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
RawAudioSample::RawAudioSample(uint8 *buffer_, uint32 size_, uint32 rate_,
bool signeddata_, bool stereo_)
@@ -74,6 +73,5 @@ uint32 RawAudioSample::decompressFrame(void *DecompData, void *samples) const {
return count;
}
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/audio/raw_audio_sample.h b/engines/ultima/ultima8/audio/raw_audio_sample.h
index 53eed9b..24b52c4 100644
--- a/engines/ultima/ultima8/audio/raw_audio_sample.h
+++ b/engines/ultima/ultima8/audio/raw_audio_sample.h
@@ -27,7 +27,6 @@
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
class RawAudioSample : public AudioSample {
public:
@@ -49,7 +48,6 @@ protected:
};
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/audio/sonarc_audio_sample.cpp b/engines/ultima/ultima8/audio/sonarc_audio_sample.cpp
index 719c96e..bf13c3d 100644
--- a/engines/ultima/ultima8/audio/sonarc_audio_sample.cpp
+++ b/engines/ultima/ultima8/audio/sonarc_audio_sample.cpp
@@ -26,7 +26,6 @@
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
bool SonarcAudioSample::GeneratedOneTable = false;
int SonarcAudioSample::OneTable[256];
@@ -244,6 +243,5 @@ void SonarcAudioSample::rewind(void *DecompData) const {
decomp->sample_pos = 0;
}
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/audio/sonarc_audio_sample.h b/engines/ultima/ultima8/audio/sonarc_audio_sample.h
index ce08dba..f454736 100644
--- a/engines/ultima/ultima8/audio/sonarc_audio_sample.h
+++ b/engines/ultima/ultima8/audio/sonarc_audio_sample.h
@@ -27,7 +27,6 @@
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
class SonarcAudioSample : public AudioSample {
struct SonarcDecompData {
@@ -58,7 +57,6 @@ public:
virtual void rewind(void *DecompData) const;
};
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/audio/sound_flex.cpp b/engines/ultima/ultima8/audio/sound_flex.cpp
index da71493..05898f1 100644
--- a/engines/ultima/ultima8/audio/sound_flex.cpp
+++ b/engines/ultima/ultima8/audio/sound_flex.cpp
@@ -29,7 +29,7 @@
namespace Ultima {
namespace Ultima8 {
-DEFINE_RUNTIME_CLASSTYPE_CODE(SoundFlex, Pentagram::Archive)
+DEFINE_RUNTIME_CLASSTYPE_CODE(SoundFlex, Archive)
SoundFlex::SoundFlex(IDataSource *ds) : Archive(ds) {
@@ -45,8 +45,8 @@ void SoundFlex::cache(uint32 index) {
if (index >= count) return;
if (!samples) {
- samples = new Pentagram::AudioSample * [count];
- Std::memset(samples, 0, sizeof(Pentagram::AudioSample *) * count);
+ samples = new AudioSample * [count];
+ Std::memset(samples, 0, sizeof(AudioSample *) * count);
}
if (samples[index]) return;
@@ -57,7 +57,7 @@ void SoundFlex::cache(uint32 index) {
if (!buf || !size) return;
- samples[index] = new Pentagram::SonarcAudioSample(buf, size);
+ samples[index] = new SonarcAudioSample(buf, size);
}
void SoundFlex::uncache(uint32 index) {
diff --git a/engines/ultima/ultima8/audio/sound_flex.h b/engines/ultima/ultima8/audio/sound_flex.h
index a8ef4cf..1d6a5cb 100644
--- a/engines/ultima/ultima8/audio/sound_flex.h
+++ b/engines/ultima/ultima8/audio/sound_flex.h
@@ -28,11 +28,10 @@
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
+
class AudioSample;
-}
-class SoundFlex : protected Pentagram::Archive {
+class SoundFlex : protected Archive {
public:
ENABLE_RUNTIME_CLASSTYPE()
@@ -40,7 +39,7 @@ public:
~SoundFlex();
//! Get an audiosample
- Pentagram::AudioSample *getSample(uint32 index) {
+ AudioSample *getSample(uint32 index) {
if (index >= count) return 0;
cache(index);
return samples[index];
@@ -51,7 +50,7 @@ public:
virtual bool isCached(uint32 index) override;
private:
- Pentagram::AudioSample **samples;
+ AudioSample **samples;
};
} // End of namespace Ultima8
diff --git a/engines/ultima/ultima8/audio/speech_flex.cpp b/engines/ultima/ultima8/audio/speech_flex.cpp
index 8ad5c07..77bd025 100644
--- a/engines/ultima/ultima8/audio/speech_flex.cpp
+++ b/engines/ultima/ultima8/audio/speech_flex.cpp
@@ -35,13 +35,13 @@ SpeechFlex::SpeechFlex(IDataSource *ds) : SoundFlex(ds) {
uint32 size = getRawSize(0);
uint8 *buf = getRawObject(0);
- Pentagram::istring strings(reinterpret_cast<char *>(buf), size);
- Std::vector<Pentagram::istring> s;
- Pentagram::SplitString(strings, 0, s);
+ istring strings(reinterpret_cast<char *>(buf), size);
+ Std::vector<istring> s;
+ SplitString(strings, 0, s);
for (unsigned int i = 0; i < s.size(); ++i) {
- Pentagram::TabsToSpaces(s[i], 1);
- Pentagram::TrimSpaces(s[i]);
+ TabsToSpaces(s[i], 1);
+ TrimSpaces(s[i]);
// pout << "Found string: \"" << s[i] << "\"" << Std::endl;
@@ -57,11 +57,11 @@ SpeechFlex::~SpeechFlex(void) {
int SpeechFlex::getIndexForPhrase(const Std::string &phrase,
uint32 start, uint32 &end) const {
- Std::vector<Pentagram::istring>::const_iterator it;
+ Std::vector<istring>::const_iterator it;
int i = 1;
Std::string text = phrase.substr(start);
- Pentagram::TabsToSpaces(text, 1);
+ TabsToSpaces(text, 1);
Std::string::size_type pos1 = text.findFirstNotOf(' ');
if (pos1 == Std::string::npos) return 0;
@@ -96,7 +96,7 @@ uint32 SpeechFlex::getSpeechLength(const Std::string &phrase) {
int index = getIndexForPhrase(phrase, start, end);
if (!index) break;
- Pentagram::AudioSample *sample = getSample(index);
+ AudioSample *sample = getSample(index);
if (!sample) break;
uint32 samples_ = sample->getLength();
diff --git a/engines/ultima/ultima8/audio/speech_flex.h b/engines/ultima/ultima8/audio/speech_flex.h
index 28e13d9..bd964d4 100644
--- a/engines/ultima/ultima8/audio/speech_flex.h
+++ b/engines/ultima/ultima8/audio/speech_flex.h
@@ -31,7 +31,7 @@ namespace Ultima {
namespace Ultima8 {
class SpeechFlex : public SoundFlex {
- Std::vector<Pentagram::istring> phrases;
+ Std::vector<istring> phrases;
public:
// p_dynamic_class stuff
diff --git a/engines/ultima/ultima8/conf/config_file_manager.cpp b/engines/ultima/ultima8/conf/config_file_manager.cpp
index dda9e0f..16a3584 100644
--- a/engines/ultima/ultima8/conf/config_file_manager.cpp
+++ b/engines/ultima/ultima8/conf/config_file_manager.cpp
@@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
namespace Ultima {
namespace Ultima8 {
-using Pentagram::istring;
using Std::string;
ConfigFileManager *ConfigFileManager::configfilemanager = 0;
@@ -87,7 +86,7 @@ void ConfigFileManager::clear() {
inifiles.clear();
}
-void ConfigFileManager::clearRoot(Pentagram::istring root) {
+void ConfigFileManager::clearRoot(istring root) {
Std::vector<INIFile *>::iterator i = inifiles.begin();
while (i != inifiles.end()) {
diff --git a/engines/ultima/ultima8/conf/config_file_manager.h b/engines/ultima/ultima8/conf/config_file_manager.h
index 986308b..0434b3b 100644
--- a/engines/ultima/ultima8/conf/config_file_manager.h
+++ b/engines/ultima/ultima8/conf/config_file_manager.h
@@ -41,68 +41,68 @@ public:
//! \param root The name of the root node in the file
//! \param readonly If true, don't write to this file's tree (or the file)
//! \return true if succesful
- bool readConfigFile(Std::string fname, Pentagram::istring root,
+ bool readConfigFile(Std::string fname, istring root,
bool readonly = false);
- bool readConfigString(Std::string config, Pentagram::istring root,
+ bool readConfigString(Std::string config, istring root,
bool readonly = false);
//! write all (writable) config files in the given root
//! \param root The root to write, or empty string to write everything
- void write(Pentagram::istring root = "");
+ void write(istring root = "");
//! clear everything
void clear();
//! clear everything in a root
- void clearRoot(Pentagram::istring root);
+ void clearRoot(istring root);
//! does the key exist?
- bool exists(Pentagram::istring key);
+ bool exists(istring key);
//! get value
- bool get(Pentagram::istring key, Std::string &ret);
+ bool get(istring key, Std::string &ret);
//! get value
- bool get(Pentagram::istring key, int &ret);
+ bool get(istring key, int &ret);
//! get value
- bool get(Pentagram::istring, bool &ret);
+ bool get(istring, bool &ret);
//! set value
- void set(Pentagram::istring key, Std::string value);
+ void set(istring key, Std::string value);
//! set value
- void set(Pentagram::istring key, const char *value);
+ void set(istring key, const char *value);
//! set value
- void set(Pentagram::istring key, int value);
+ void set(istring key, int value);
//! set value
- void set(Pentagram::istring key, bool value);
+ void set(istring key, bool value);
//! remove key
- void unset(Pentagram::istring key);
+ void unset(istring key);
//! list all keys in a section
//! \param section The section to return setkeys of
//! \param longformat If true, return the full key name, instead of
//! just the last part
//! \return the keys. They have no guaranteed order.
- Std::vector<Pentagram::istring> listKeys(Pentagram::istring section,
+ Std::vector<istring> listKeys(istring section,
bool longformat = false);
//! list all sections
//! \param root The config root to list all sections in
//! \param longformat If true, return the full key name (including section)
//! \return the sections. They have no guaranteed order.
- Std::vector<Pentagram::istring> listSections(Pentagram::istring root,
+ Std::vector<istring> listSections(istring root,
bool longformat = false);
//! list all key-value pairs in the given section.
//! \param section The section to list
//! \param longformat If true, return the full key name (including section)
//! \return the key-value pairs. They have no guaranteed order.
- KeyMap listKeyValues(Pentagram::istring section, bool longformat = false);
+ KeyMap listKeyValues(istring section, bool longformat = false);
private:
- INIFile *findKeyINI(Pentagram::istring key);
- INIFile *findWriteINI(Pentagram::istring key);
+ INIFile *findKeyINI(istring key);
+ INIFile *findWriteINI(istring key);
Std::vector<INIFile *> inifiles;
diff --git a/engines/ultima/ultima8/conf/ini_file.cpp b/engines/ultima/ultima8/conf/ini_file.cpp
index a9d1604..58e80e8 100644
--- a/engines/ultima/ultima8/conf/ini_file.cpp
+++ b/engines/ultima/ultima8/conf/ini_file.cpp
@@ -25,7 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
namespace Ultima {
namespace Ultima8 {
-using Pentagram::istring;
using Std::string;
INIFile::INIFile()
diff --git a/engines/ultima/ultima8/conf/ini_file.h b/engines/ultima/ultima8/conf/ini_file.h
index 2269a95..4877d33 100644
--- a/engines/ultima/ultima8/conf/ini_file.h
+++ b/engines/ultima/ultima8/conf/ini_file.h
@@ -24,12 +24,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
namespace Ultima {
namespace Ultima8 {
-typedef Std::map<Pentagram::istring, Std::string, Common::IgnoreCase_Hash> KeyMap;
+typedef Std::map<istring, Std::string, Common::IgnoreCase_Hash> KeyMap;
class INIFile {
public:
INIFile();
- INIFile(Std::string fname, Pentagram::istring root);
+ INIFile(Std::string fname, istring root);
~INIFile();
bool readConfigFile(Std::string fname);
@@ -37,7 +37,7 @@ public:
//! read configuration from a string s. Lines must be separated by \n
bool readConfigString(Std::string s);
- void clear(Pentagram::istring root);
+ void clear(istring root);
Std::string dump();
void write();
@@ -49,56 +49,56 @@ public:
return readonly;
}
- bool hasSection(Pentagram::istring section);
- bool hasKey(Pentagram::istring key);
- bool checkRoot(Pentagram::istring key);
+ bool hasSection(istring section);
+ bool hasKey(istring key);
+ bool checkRoot(istring key);
// get value
- bool value(Pentagram::istring key, Std::string &ret);
- bool value(Pentagram::istring key, int &ret);
- bool value(Pentagram::istring key, bool &ret);
+ bool value(istring key, Std::string &ret);
+ bool value(istring key, int &ret);
+ bool value(istring key, bool &ret);
// set value
- void set(Pentagram::istring key, Std::string value);
- void set(Pentagram::istring key, const char *value);
- void set(Pentagram::istring key, int value);
- void set(Pentagram::istring key, bool value);
+ void set(istring key, Std::string value);
+ void set(istring key, const char *value);
+ void set(istring key, int value);
+ void set(istring key, bool value);
// remove key
- void unset(Pentagram::istring key);
+ void unset(istring key);
- void listKeys(Std::set<Pentagram::istring> &keys,
- Pentagram::istring section,
+ void listKeys(Std::set<istring> &keys,
+ istring section,
bool longformat = false);
- void listSections(Std::set<Pentagram::istring> §ions,
+ void listSections(Std::set<istring> §ions,
bool longformat = false);
void listKeyValues(KeyMap &keyvalues,
- Pentagram::istring section,
+ istring section,
bool longformat = false);
private:
Std::string filename;
- Pentagram::istring root;
+ istring root;
bool is_file;
bool readonly;
struct KeyValue {
- Pentagram::istring key;
+ istring key;
Std::string value;
Std::string comment;
};
struct Section {
- Pentagram::istring name;
+ istring name;
Std::list<KeyValue> keys;
Std::string comment;
- bool hasKey(Pentagram::istring key);
- KeyValue *getKey(Pentagram::istring key);
- void setKey(Pentagram::istring key, Std::string value);
- void unsetKey(Pentagram::istring key);
+ bool hasKey(istring key);
+ KeyValue *getKey(istring key);
+ void setKey(istring key, Std::string value);
+ void unsetKey(istring key);
Std::string dump();
};
@@ -106,10 +106,10 @@ private:
Std::list<Section> sections;
- bool stripRoot(Pentagram::istring &key);
- Section *getSection(Pentagram::istring section);
- bool splitKey(Pentagram::istring key, Pentagram::istring §ion,
- Pentagram::istring §ionkey);
+ bool stripRoot(istring &key);
+ Section *getSection(istring section);
+ bool splitKey(istring key, istring §ion,
+ istring §ionkey);
};
diff --git a/engines/ultima/ultima8/conf/setting_manager.cpp b/engines/ultima/ultima8/conf/setting_manager.cpp
index a0fd200..f3e1975 100644
--- a/engines/ultima/ultima8/conf/setting_manager.cpp
+++ b/engines/ultima/ultima8/conf/setting_manager.cpp
@@ -24,8 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
namespace Ultima {
namespace Ultima8 {
-using Pentagram::istring;
-
SettingManager *SettingManager::settingmanager = 0;
SettingManager::SettingManager() {
diff --git a/engines/ultima/ultima8/conf/setting_manager.h b/engines/ultima/ultima8/conf/setting_manager.h
index 29121e8..811b7ce 100644
--- a/engines/ultima/ultima8/conf/setting_manager.h
+++ b/engines/ultima/ultima8/conf/setting_manager.h
@@ -51,7 +51,7 @@ public:
DOM_CURRENT = 100
};
- typedef void (*ConfigCallback)(Pentagram::istring key);
+ typedef void (*ConfigCallback)(istring key);
typedef Std::map<Common::String, Std::vector<ConfigCallback>, Common::IgnoreCase_Hash > Callbacks;
//! read a config file. Multiple files may be read. Order is important.
@@ -64,68 +64,68 @@ public:
void write();
//! does the key exist?
- bool exists(Pentagram::istring key, Domain dom = DOM_CURRENT);
+ bool exists(istring key, Domain dom = DOM_CURRENT);
//! get value
- bool get(Pentagram::istring key, Std::string &ret, Domain dom = DOM_CURRENT);
+ bool get(istring key, Std::string &ret, Domain dom = DOM_CURRENT);
//! get value
- bool get(Pentagram::istring key, int &ret, Domain dom = DOM_CURRENT);
+ bool get(istring key, int &ret, Domain dom = DOM_CURRENT);
//! get value
- bool get(Pentagram::istring key, bool &ret, Domain dom = DOM_CURRENT);
+ bool get(istring key, bool &ret, Domain dom = DOM_CURRENT);
//! set value
- void set(Pentagram::istring key, Std::string value, Domain dom = DOM_CURRENT);
+ void set(istring key, Std::string value, Domain dom = DOM_CURRENT);
//! set value
- void set(Pentagram::istring key, const char *value, Domain dom = DOM_CURRENT);
+ void set(istring key, const char *value, Domain dom = DOM_CURRENT);
//! set value
- void set(Pentagram::istring key, int value, Domain dom = DOM_CURRENT);
+ void set(istring key, int value, Domain dom = DOM_CURRENT);
//! set value
- void set(Pentagram::istring key, bool value, Domain dom = DOM_CURRENT);
+ void set(istring key, bool value, Domain dom = DOM_CURRENT);
//! remove key
- void unset(Pentagram::istring key, Domain dom = DOM_CURRENT);
+ void unset(istring key, Domain dom = DOM_CURRENT);
//! set default value
- void setDefault(Pentagram::istring key, Std::string value);
+ void setDefault(istring key, Std::string value);
//! set default value
- void setDefault(Pentagram::istring key, const char *value);
+ void setDefault(istring key, const char *value);
//! set default value
- void setDefault(Pentagram::istring key, int value);
+ void setDefault(istring key, int value);
//! set default value
- void setDefault(Pentagram::istring key, bool value);
+ void setDefault(istring key, bool value);
//! set the current domain
void setCurrentDomain(Domain dom);
//! set the configuration section for a domain
- void setDomainName(Domain dom, Pentagram::istring section);
+ void setDomainName(Domain dom, istring section);
//! register a function to be called when the key changes
- void registerCallback(Pentagram::istring key, ConfigCallback callback);
+ void registerCallback(istring key, ConfigCallback callback);
//! unregister a callback
- void unregisterCallback(Pentagram::istring key, ConfigCallback callback);
+ void unregisterCallback(istring key, ConfigCallback callback);
//! list all games
- Std::vector<Pentagram::istring> listGames();
+ Std::vector<istring> listGames();
//! list all keys in a game data section
//! \param section The section to return setkeys of
//! \return the keys. They have no guaranteed order.
- Std::vector<Pentagram::istring> listDataKeys(Pentagram::istring section);
+ Std::vector<istring> listDataKeys(istring section);
//! list all key-value pairs in the given section.
//! \param section The section to list
//! \return the key-value pairs. They have no guaranteed order.
- KeyMap listDataValues(Pentagram::istring section);
+ KeyMap listDataValues(istring section);
private:
- bool findKeyDomain(Pentagram::istring key, Domain dom, Domain &keydom);
- Pentagram::istring getConfigKey(Pentagram::istring key, Domain dom);
- void callCallbacks(Pentagram::istring key);
+ bool findKeyDomain(istring key, Domain dom, Domain &keydom);
+ istring getConfigKey(istring key, Domain dom);
+ void callCallbacks(istring key);
void setupScummVMSettings();
Callbacks callbacks;
- Std::vector<Pentagram::istring> domains;
+ Std::vector<istring> domains;
Domain currentDomain;
diff --git a/engines/ultima/ultima8/filesys/archive.cpp b/engines/ultima/ultima8/filesys/archive.cpp
index 9ae2153..991d86b 100644
--- a/engines/ultima/ultima8/filesys/archive.cpp
+++ b/engines/ultima/ultima8/filesys/archive.cpp
@@ -34,9 +34,6 @@ namespace Ultima {
namespace Ultima8 {
DEFINE_RUNTIME_CLASSTYPE_CODE(NamedArchiveFile, ArchiveFile)
-
-namespace Pentagram {
-
DEFINE_RUNTIME_CLASSTYPE_CODE_BASE_CLASS(Archive)
Archive::Archive() {
@@ -138,6 +135,5 @@ ArchiveFile *Archive::findArchiveFile(uint32 index) {
return 0;
}
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/filesys/archive.h b/engines/ultima/ultima8/filesys/archive.h
index ad5934f..a914865 100644
--- a/engines/ultima/ultima8/filesys/archive.h
+++ b/engines/ultima/ultima8/filesys/archive.h
@@ -33,8 +33,6 @@ namespace Ultima8 {
class ArchiveFile;
class IDataSource;
-namespace Pentagram {
-
class Archive {
public:
ENABLE_RUNTIME_CLASSTYPE_BASE()
@@ -102,7 +100,6 @@ private:
ArchiveFile *findArchiveFile(uint32 index);
};
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/filesys/raw_archive.cpp b/engines/ultima/ultima8/filesys/raw_archive.cpp
index c2cb683..7cdc366 100644
--- a/engines/ultima/ultima8/filesys/raw_archive.cpp
+++ b/engines/ultima/ultima8/filesys/raw_archive.cpp
@@ -29,7 +29,7 @@
namespace Ultima {
namespace Ultima8 {
-DEFINE_RUNTIME_CLASSTYPE_CODE(RawArchive, Pentagram::Archive)
+DEFINE_RUNTIME_CLASSTYPE_CODE(RawArchive, Archive)
RawArchive::~RawArchive() {
Archive::uncache();
diff --git a/engines/ultima/ultima8/filesys/raw_archive.h b/engines/ultima/ultima8/filesys/raw_archive.h
index e534a9f..e63f2d4 100644
--- a/engines/ultima/ultima8/filesys/raw_archive.h
+++ b/engines/ultima/ultima8/filesys/raw_archive.h
@@ -32,7 +32,7 @@ namespace Ultima8 {
class ArchiveFile;
class IDataSource;
-class RawArchive : public Pentagram::Archive {
+class RawArchive : public Archive {
public:
ENABLE_RUNTIME_CLASSTYPE()
diff --git a/engines/ultima/ultima8/games/game_data.cpp b/engines/ultima/ultima8/games/game_data.cpp
index 8a6a17e..107e1c2 100644
--- a/engines/ultima/ultima8/games/game_data.cpp
+++ b/engines/ultima/ultima8/games/game_data.cpp
@@ -176,7 +176,7 @@ Std::string GameData::translate(Std::string text) {
// TODO: maybe cache these lookups? config calls may be expensive
ConfigFileManager *config = ConfigFileManager::get_instance();
- Pentagram::istring key = "language/text/" + text;
+ istring key = "language/text/" + text;
if (!config->exists(key))
return text;
@@ -191,7 +191,7 @@ FrameID GameData::translate(FrameID f) {
// TODO: allow translations to be in another shapeflex
ConfigFileManager *config = ConfigFileManager::get_instance();
- Pentagram::istring key = "language/";
+ istring key = "language/";
switch (f.flexid) {
case GUMPS:
key += "gumps/";
@@ -379,7 +379,7 @@ void GameData::setupJPOverrides() {
Std::string fontdesc = iter->_value;
Std::vector<Std::string> vals;
- Pentagram::SplitString(fontdesc, ',', vals);
+ SplitString(fontdesc, ',', vals);
if (vals.size() != 2) {
perr << "Invalid jpfont override: " << fontdesc << Std::endl;
continue;
@@ -417,7 +417,7 @@ void GameData::setupTTFOverrides(const char *configkey, bool SJIS) {
Std::string fontdesc = iter->_value;
Std::vector<Std::string> vals;
- Pentagram::SplitString(fontdesc, ',', vals);
+ SplitString(fontdesc, ',', vals);
if (vals.size() != 4) {
perr << "Invalid ttf override: " << fontdesc << Std::endl;
continue;
diff --git a/engines/ultima/ultima8/games/game_detector.cpp b/engines/ultima/ultima8/games/game_detector.cpp
index 759ebd5..6976ca4 100644
--- a/engines/ultima/ultima8/games/game_detector.cpp
+++ b/engines/ultima/ultima8/games/game_detector.cpp
@@ -55,17 +55,17 @@ bool GameDetector::detect(Std::string path, GameInfo *info) {
if (!ids)
return false; // all games have usecode
- Pentagram::md5_file(ids, info->md5, 0);
+ md5_file(ids, info->md5, 0);
delete ids;
Std::string md5s = info->getPrintableMD5();
int i = 0;
- while (Pentagram::md5table[i].md5) {
- if (md5s == Pentagram::md5table[i].md5) {
- info->type = Pentagram::md5table[i].type;
- info->language = Pentagram::md5table[i].language;
- info->version = Pentagram::md5table[i].version;
+ while (md5table[i].md5) {
+ if (md5s == md5table[i].md5) {
+ info->type = md5table[i].type;
+ info->language = md5table[i].language;
+ info->version = md5table[i].version;
return true;
}
i++;
diff --git a/engines/ultima/ultima8/games/game_info.cpp b/engines/ultima/ultima8/games/game_info.cpp
index 91a7554..b84ea08 100644
--- a/engines/ultima/ultima8/games/game_info.cpp
+++ b/engines/ultima/ultima8/games/game_info.cpp
@@ -193,7 +193,7 @@ bool GameInfo::load(IDataSource *ids, uint32 version_) {
Std::vector<Std::string> parts;
ids->readline(s);
- Pentagram::SplitString(s, ',', parts);
+ SplitString(s, ',', parts);
if (parts.size() != 4) return false;
int i = 0;
diff --git a/engines/ultima/ultima8/games/game_info.h b/engines/ultima/ultima8/games/game_info.h
index de9fea5..85913f7 100644
--- a/engines/ultima/ultima8/games/game_info.h
+++ b/engines/ultima/ultima8/games/game_info.h
@@ -35,7 +35,7 @@ class ODataSource;
struct GameInfo {
GameInfo();
- Pentagram::istring name;
+ istring name;
enum GameType {
GAME_UNKNOWN = 0,
diff --git a/engines/ultima/ultima8/games/game_md5.h b/engines/ultima/ultima8/games/game_md5.h
index f309f9d..46ebc91 100644
--- a/engines/ultima/ultima8/games/game_md5.h
+++ b/engines/ultima/ultima8/games/game_md5.h
@@ -27,7 +27,6 @@
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
struct GameMD5Entry {
GameInfo::GameType type;
@@ -133,7 +132,6 @@ static GameMD5Entry md5table[] = {
{ GameInfo::GAME_UNKNOWN, GameInfo::GAMELANG_UNKNOWN, 0, 0 }
};
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/games/treasure_loader.cpp b/engines/ultima/ultima8/games/treasure_loader.cpp
index e2acb44..d313440 100644
--- a/engines/ultima/ultima8/games/treasure_loader.cpp
+++ b/engines/ultima/ultima8/games/treasure_loader.cpp
@@ -59,7 +59,7 @@ bool TreasureLoader::parse(Std::string desc,
treasure.clear();
Std::vector<Std::string> tr;
- Pentagram::SplitString(desc, ';', tr);
+ SplitString(desc, ';', tr);
TreasureInfo ti;
for (unsigned int i = 0; i < tr.size(); ++i) {
@@ -86,7 +86,7 @@ bool TreasureLoader::internalParse(Std::string desc, TreasureInfo &ti,
bool loadedDefault = false;
Std::vector<Std::pair<Std::string, Std::string> > kv;
- Pentagram::SplitStringKV(desc, ' ', kv);
+ SplitStringKV(desc, ' ', kv);
for (unsigned int i = 0; i < kv.size(); ++i) {
Std::string key = kv[i].first;
diff --git a/engines/ultima/ultima8/games/treasure_loader.h b/engines/ultima/ultima8/games/treasure_loader.h
index d4c4232..d1ae5ce 100644
--- a/engines/ultima/ultima8/games/treasure_loader.h
+++ b/engines/ultima/ultima8/games/treasure_loader.h
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
namespace Ultima {
namespace Ultima8 {
-typedef Std::map<Pentagram::istring, TreasureInfo, Common::IgnoreCase_Hash> TreasureMap;
+typedef Std::map<istring, TreasureInfo, Common::IgnoreCase_Hash> TreasureMap;
class TreasureLoader {
public:
diff --git a/engines/ultima/ultima8/graphics/base_soft_render_surface.cpp b/engines/ultima/ultima8/graphics/base_soft_render_surface.cpp
index 16edcd7..b402671 100644
--- a/engines/ultima/ultima8/graphics/base_soft_render_surface.cpp
+++ b/engines/ultima/ultima8/graphics/base_soft_render_surface.cpp
@@ -29,8 +29,6 @@
namespace Ultima {
namespace Ultima8 {
-using Pentagram::Rect;
-
///////////////////////////
// //
// BaseSoftRenderSurface //
@@ -340,7 +338,7 @@ Texture *BaseSoftRenderSurface::GetSurfaceAsTexture() {
//
// Desc: Create a palette of colours native to the surface
//
-void BaseSoftRenderSurface::CreateNativePalette(Pentagram::Palette *palette) {
+void BaseSoftRenderSurface::CreateNativePalette(Palette *palette) {
for (int i = 0; i < 256; i++) {
int32 r, g, b;
diff --git a/engines/ultima/ultima8/graphics/base_soft_render_surface.h b/engines/ultima/ultima8/graphics/base_soft_render_surface.h
index ce3c40a..1669ade 100644
--- a/engines/ultima/ultima8/graphics/base_soft_render_surface.h
+++ b/engines/ultima/ultima8/graphics/base_soft_render_surface.h
@@ -58,7 +58,7 @@ protected:
bool flipped;
// Clipping Rectangle
- Pentagram::Rect clip_window;
+ Rect clip_window;
// Locking count
uint32 lock_count; // Number of locks on surface
@@ -131,16 +131,16 @@ public:
virtual void GetOrigin(int32 &x, int32 &y) const override;
// Get the Surface Dimensions
- virtual void GetSurfaceDims(Pentagram::Rect &) const override;
+ virtual void GetSurfaceDims(Rect &) const override;
// Get Clipping Rectangle
- virtual void GetClippingRect(Pentagram::Rect &) const override;
+ virtual void GetClippingRect(Rect &) const override;
// Set Clipping Rectangle
- virtual void SetClippingRect(const Pentagram::Rect &);
+ virtual void SetClippingRect(const Rect &);
// Check Clipped. -1 if off screen, 0 if not clipped, 1 if clipped
- virtual int16 CheckClipped(const Pentagram::Rect &) const override;
+ virtual int16 CheckClipped(const Rect &) const override;
// Flip the surface
virtual void SetFlipped(bool flipped) override;
@@ -164,7 +164,7 @@ public:
// Get The Surface Palette
// TODO: virtual void GetPalette(uint8 palette[768]);
- virtual void CreateNativePalette(Pentagram::Palette *palette);
+ virtual void CreateNativePalette(Palette *palette);
Graphics::ManagedSurface *getRawSurface() const override {
return sdl_surf;
diff --git a/engines/ultima/ultima8/graphics/fonts/font.cpp b/engines/ultima/ultima8/graphics/fonts/font.cpp
index eb970c0..3d4c35d 100644
--- a/engines/ultima/ultima8/graphics/fonts/font.cpp
+++ b/engines/ultima/ultima8/graphics/fonts/font.cpp
@@ -26,7 +26,6 @@
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
DEFINE_RUNTIME_CLASSTYPE_CODE_BASE_CLASS(Font)
@@ -148,8 +147,6 @@ bool Font::SJISTraits::canBreakAfter(Std::string::const_iterator &i) {
return true;
}
-} // End of namespace Pentagram
-
template<class T>
static void findWordEnd(const Std::string &text,
Std::string::const_iterator &iter, bool u8specials) {
@@ -184,9 +181,9 @@ CHECKME: any others? (page breaks for books?)
*/
template<class T>
-Std::list<PositionedText> typesetText(Pentagram::Font *font,
+Std::list<PositionedText> typesetText(Font *font,
const Std::string &text, unsigned int &remaining, int32 width, int32 height,
- Pentagram::Font::TextAlign align, bool u8specials, int32 &resultwidth,
+ Font::TextAlign align, bool u8specials, int32 &resultwidth,
int32 &resultheight, Std::string::size_type cursor) {
#if 0
pout << "typeset (" << width << "," << height << ") : "
@@ -332,7 +329,7 @@ Std::list<PositionedText> typesetText(Pentagram::Font *font,
}
}
- if (lines.size() == 1 && align == Pentagram::Font::TEXT_LEFT) {
+ if (lines.size() == 1 && align == Font::TEXT_LEFT) {
// only one line, so use the actual text width
width = totalwidth;
}
@@ -347,12 +344,12 @@ Std::list<PositionedText> typesetText(Pentagram::Font *font,
Std::list<PositionedText>::iterator lineiter;
for (lineiter = lines.begin(); lineiter != lines.end(); ++lineiter) {
switch (align) {
- case Pentagram::Font::TEXT_LEFT:
+ case Font::TEXT_LEFT:
break;
- case Pentagram::Font::TEXT_RIGHT:
+ case Font::TEXT_RIGHT:
lineiter->dims.x = totalwidth - lineiter->dims.w;
break;
- case Pentagram::Font::TEXT_CENTER:
+ case Font::TEXT_CENTER:
lineiter->dims.x = (totalwidth - lineiter->dims.w) / 2;
break;
}
@@ -372,17 +369,17 @@ Std::list<PositionedText> typesetText(Pentagram::Font *font,
// explicit instantiations
template
-Std::list<PositionedText> typesetText<Pentagram::Font::Traits>
-(Pentagram::Font *font, const Std::string &text,
+Std::list<PositionedText> typesetText<Font::Traits>
+(Font *font, const Std::string &text,
unsigned int &remaining, int32 width, int32 height,
- Pentagram::Font::TextAlign align, bool u8specials,
+ Font::TextAlign align, bool u8specials,
int32 &resultwidth, int32 &resultheight, Std::string::size_type cursor);
template
-Std::list<PositionedText> typesetText<Pentagram::Font::SJISTraits>
-(Pentagram::Font *font, const Std::string &text,
+Std::list<PositionedText> typesetText<Font::SJISTraits>
+(Font *font, const Std::string &text,
unsigned int &remaining, int32 width, int32 height,
- Pentagram::Font::TextAlign align, bool u8specials,
+ Font::TextAlign align, bool u8specials,
int32 &resultwidth, int32 &resultheight, Std::string::size_type cursor);
} // End of namespace Ultima8
diff --git a/engines/ultima/ultima8/graphics/fonts/font.h b/engines/ultima/ultima8/graphics/fonts/font.h
index 3acc7d6..3b4bfeb 100644
--- a/engines/ultima/ultima8/graphics/fonts/font.h
+++ b/engines/ultima/ultima8/graphics/fonts/font.h
@@ -35,12 +35,10 @@ class RenderedText;
struct PositionedText {
Std::string text;
- Pentagram::Rect dims;
+ Rect dims;
Std::string::size_type cursor;
};
-namespace Pentagram {
-
class Font {
public:
Font();
@@ -134,7 +132,7 @@ protected:
return t.size();
}
static uint32 unicode(Std::string::const_iterator &i) {
- return Pentagram::encoding[static_cast<uint8>(*i++)];
+ return encoding[static_cast<uint8>(*i++)];
}
};
struct SJISTraits : public Traits {
@@ -161,17 +159,15 @@ protected:
uint16 t = static_cast<uint8>(*i++);
s |= (t << 8);
}
- return Pentagram::shiftjis_to_unicode(s);
+ return shiftjis_to_unicode(s);
}
};
};
-}
-
template<class T>
-Std::list<PositionedText> typesetText(Pentagram::Font *font,
+Std::list<PositionedText> typesetText(Font *font,
const Std::string &text, unsigned int &remaining,
- int32 width, int32 height, Pentagram::Font::TextAlign align,
+ int32 width, int32 height, Font::TextAlign align,
bool u8specials, int32 &resultwidth, int32 &resultheight,
Std::string::size_type cursor = Std::string::npos);
diff --git a/engines/ultima/ultima8/graphics/fonts/font_manager.cpp b/engines/ultima/ultima8/graphics/fonts/font_manager.cpp
index fbeedde..d5c9a34 100644
--- a/engines/ultima/ultima8/graphics/fonts/font_manager.cpp
+++ b/engines/ultima/ultima8/graphics/fonts/font_manager.cpp
@@ -76,7 +76,7 @@ void FontManager::resetGameFonts() {
overrides.clear();
}
-Pentagram::Font *FontManager::getGameFont(unsigned int fontnum,
+Font *FontManager::getGameFont(unsigned int fontnum,
bool allowOverride) {
if (allowOverride && fontnum < overrides.size() && overrides[fontnum])
return overrides[fontnum];
@@ -84,7 +84,7 @@ Pentagram::Font *FontManager::getGameFont(unsigned int fontnum,
return GameData::get_instance()->getFonts()->getFont(fontnum);
}
-Pentagram::Font *FontManager::getTTFont(unsigned int fontnum) {
+Font *FontManager::getTTFont(unsigned int fontnum) {
if (fontnum >= ttfonts.size())
return 0;
return ttfonts[fontnum];
@@ -128,7 +128,7 @@ Graphics::Font *FontManager::getTTF_Font(Std::string filename, int pointsize) {
return font;
}
-void FontManager::setOverride(unsigned int fontnum, Pentagram::Font *newFont) {
+void FontManager::setOverride(unsigned int fontnum, Font *newFont) {
if (fontnum >= overrides.size())
overrides.resize(fontnum + 1);
@@ -175,7 +175,7 @@ bool FontManager::addJPOverride(unsigned int fontnum,
PaletteManager::PalIndex fontpal = static_cast<PaletteManager::PalIndex>
(PaletteManager::Pal_JPFontStart + fontnum);
palman->duplicate(PaletteManager::Pal_Game, fontpal);
- Pentagram::Palette *pal = palman->getPalette(fontpal);
+ Palette *pal = palman->getPalette(fontpal);
// TODO: maybe a small gradient
// the main text uses index 3
// indices 1,2 and 3 are in use for the bullets for conversation options
diff --git a/engines/ultima/ultima8/graphics/fonts/font_manager.h b/engines/ultima/ultima8/graphics/fonts/font_manager.h
index b590237..bac9b65 100644
--- a/engines/ultima/ultima8/graphics/fonts/font_manager.h
+++ b/engines/ultima/ultima8/graphics/fonts/font_manager.h
@@ -28,10 +28,8 @@
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
-class Font;
-}
+class Font;
// This is TTF_Font struct from SDL_ttf
typedef struct _TTF_Font TTF_Font;
@@ -74,11 +72,11 @@ private:
Graphics::Font *getTTF_Font(Std::string filename, int pointsize);
//! Override fontnum with specified font
- void setOverride(unsigned int fontnum, Pentagram::Font *newFont);
+ void setOverride(unsigned int fontnum, Font *newFont);
- Std::vector<Pentagram::Font *> overrides;
+ Std::vector<Font *> overrides;
- Std::vector<Pentagram::Font *> ttfonts;
+ Std::vector<Font *> ttfonts;
static FontManager *fontmanager;
public:
@@ -92,11 +90,11 @@ public:
//! get a Font by fontnum (for game fonts)
//! \param fontnum the number of the font
//! \param allowOverride if true, allow an override font to be used
- Pentagram::Font *getGameFont(unsigned int fontnum,
+ Font *getGameFont(unsigned int fontnum,
bool allowOverride = false);
//! get a TTF font (for non-game fonts)
- Pentagram::Font *getTTFont(unsigned int ttfnum);
+ Font *getTTFont(unsigned int ttfnum);
//! override a game font with a TTF.
//! \param fontnum the font to override
diff --git a/engines/ultima/ultima8/graphics/fonts/font_shape_archive.cpp b/engines/ultima/ultima8/graphics/fonts/font_shape_archive.cpp
index c0ec319..f8490bb 100644
--- a/engines/ultima/ultima8/graphics/fonts/font_shape_archive.cpp
+++ b/engines/ultima/ultima8/graphics/fonts/font_shape_archive.cpp
@@ -73,7 +73,7 @@ void FontShapeArchive::setHVLeads() {
Std::string leaddesc = iter->_value;
Std::vector<Std::string> vals;
- Pentagram::SplitString(leaddesc, ',', vals);
+ SplitString(leaddesc, ',', vals);
if (vals.size() != 2) {
perr << "Invalid hlead/vlead description: " << leaddesc
<< Std::endl;
diff --git a/engines/ultima/ultima8/graphics/fonts/font_shape_archive.h b/engines/ultima/ultima8/graphics/fonts/font_shape_archive.h
index 9d8df28..328a10c 100644
--- a/engines/ultima/ultima8/graphics/fonts/font_shape_archive.h
+++ b/engines/ultima/ultima8/graphics/fonts/font_shape_archive.h
@@ -35,17 +35,17 @@ class FontShapeArchive : public ShapeArchive {
public:
ENABLE_RUNTIME_CLASSTYPE()
- FontShapeArchive(uint16 id_, Pentagram::Palette *pal_ = 0,
+ FontShapeArchive(uint16 id_, Palette *pal_ = 0,
const ConvertShapeFormat *format_ = 0)
: ShapeArchive(id_, pal_, format_) { }
- FontShapeArchive(ArchiveFile *af, uint16 id_, Pentagram::Palette *pal_ = 0,
+ FontShapeArchive(ArchiveFile *af, uint16 id_, Palette *pal_ = 0,
const ConvertShapeFormat *format_ = 0)
: ShapeArchive(af, id_, pal_, format_) { }
- FontShapeArchive(IDataSource *ds, uint16 id_, Pentagram::Palette *pal_ = 0,
+ FontShapeArchive(IDataSource *ds, uint16 id_, Palette *pal_ = 0,
const ConvertShapeFormat *format_ = 0)
: ShapeArchive(ds, id_, pal_, format_) { }
FontShapeArchive(const Std::string &path, uint16 id_,
- Pentagram::Palette *pal_ = 0,
+ Palette *pal_ = 0,
const ConvertShapeFormat *format_ = 0)
: ShapeArchive(path, id_, pal_, format_) { }
diff --git a/engines/ultima/ultima8/graphics/fonts/jp_font.cpp b/engines/ultima/ultima8/graphics/fonts/jp_font.cpp
index 3cbe18e..f4e5944 100644
--- a/engines/ultima/ultima8/graphics/fonts/jp_font.cpp
+++ b/engines/ultima/ultima8/graphics/fonts/jp_font.cpp
@@ -31,7 +31,7 @@
namespace Ultima {
namespace Ultima8 {
-DEFINE_RUNTIME_CLASSTYPE_CODE(JPFont, Pentagram::Font)
+DEFINE_RUNTIME_CLASSTYPE_CODE(JPFont, Font)
JPFont::JPFont(ShapeFont *jpfont, unsigned int fontnum_)
@@ -75,7 +75,7 @@ void JPFont::getStringSize(const Std::string &text, int32 &width, int32 &height)
uint16 t = text[++i] & 0xFF;
sjis += (t << 8);
}
- width += getWidth(Pentagram::shiftjis_to_ultima8(sjis)) - hlead;
+ width += getWidth(shiftjis_to_ultima8(sjis)) - hlead;
}
}
}
diff --git a/engines/ultima/ultima8/graphics/fonts/jp_font.h b/engines/ultima/ultima8/graphics/fonts/jp_font.h
index 41b87e8..47095ce 100644
--- a/engines/ultima/ultima8/graphics/fonts/jp_font.h
+++ b/engines/ultima/ultima8/graphics/fonts/jp_font.h
@@ -31,7 +31,7 @@ namespace Ultima8 {
class ShapeFont;
-class JPFont : public Pentagram::Font {
+class JPFont : public Font {
public:
JPFont(ShapeFont *jpfont, unsigned int fontnum);
virtual ~JPFont();
diff --git a/engines/ultima/ultima8/graphics/fonts/jp_rendered_text.cpp b/engines/ultima/ultima8/graphics/fonts/jp_rendered_text.cpp
index 0d6a389..10a50a6 100644
--- a/engines/ultima/ultima8/graphics/fonts/jp_rendered_text.cpp
+++ b/engines/ultima/ultima8/graphics/fonts/jp_rendered_text.cpp
@@ -53,8 +53,8 @@ void JPRenderedText::draw(RenderSurface *surface, int x, int y, bool /*destmaske
PaletteManager *palman = PaletteManager::get_instance();
PaletteManager::PalIndex fontpal = static_cast<PaletteManager::PalIndex>
(PaletteManager::Pal_JPFontStart + fontnum);
- Pentagram::Palette *pal = palman->getPalette(fontpal);
- const Pentagram::Palette *savepal = font->getPalette();
+ Palette *pal = palman->getPalette(fontpal);
+ const Palette *savepal = font->getPalette();
font->setPalette(pal);
Std::list<PositionedText>::iterator iter;
@@ -71,7 +71,7 @@ void JPRenderedText::draw(RenderSurface *surface, int x, int y, bool /*destmaske
uint16 t = iter->text[++i] & 0xFF;
sjis += (t << 8);
}
- uint16 u8char = Pentagram::shiftjis_to_ultima8(sjis);
+ uint16 u8char = shiftjis_to_ultima8(sjis);
surface->Paint(font, u8char, line_x, line_y);
if (i == iter->cursor) {
@@ -98,8 +98,8 @@ void JPRenderedText::drawBlended(RenderSurface *surface, int x, int y,
PaletteManager *palman = PaletteManager::get_instance();
PaletteManager::PalIndex fontpal = static_cast<PaletteManager::PalIndex>
(PaletteManager::Pal_JPFontStart + fontnum);
- Pentagram::Palette *pal = palman->getPalette(fontpal);
- const Pentagram::Palette *savepal = font->getPalette();
+ Palette *pal = palman->getPalette(fontpal);
+ const Palette *savepal = font->getPalette();
font->setPalette(pal);
Std::list<PositionedText>::iterator iter;
@@ -116,7 +116,7 @@ void JPRenderedText::drawBlended(RenderSurface *surface, int x, int y,
uint16 t = iter->text[++i] & 0xFF;
sjis += (t << 8);
}
- uint16 u8char = Pentagram::shiftjis_to_ultima8(sjis);
+ uint16 u8char = shiftjis_to_ultima8(sjis);
surface->PaintHighlight(font, u8char, line_x, line_y,
false, false, col);
diff --git a/engines/ultima/ultima8/graphics/fonts/shape_font.cpp b/engines/ultima/ultima8/graphics/fonts/shape_font.cpp
index be12839..442fa41 100644
--- a/engines/ultima/ultima8/graphics/fonts/shape_font.cpp
+++ b/engines/ultima/ultima8/graphics/fonts/shape_font.cpp
@@ -29,7 +29,7 @@
namespace Ultima {
namespace Ultima8 {
-DEFINE_RUNTIME_CLASSTYPE_CODE_MULTI2(ShapeFont, Pentagram::Font, Shape)
+DEFINE_RUNTIME_CLASSTYPE_CODE_MULTI2(ShapeFont, Font, Shape)
ShapeFont::ShapeFont(const uint8 *data_, uint32 size_,
diff --git a/engines/ultima/ultima8/graphics/fonts/shape_font.h b/engines/ultima/ultima8/graphics/fonts/shape_font.h
index b1630f4..f0449ff 100644
--- a/engines/ultima/ultima8/graphics/fonts/shape_font.h
+++ b/engines/ultima/ultima8/graphics/fonts/shape_font.h
@@ -30,7 +30,7 @@
namespace Ultima {
namespace Ultima8 {
-class ShapeFont : public Pentagram::Font, public Shape {
+class ShapeFont : public Font, public Shape {
int height;
int baseline;
int vlead;
diff --git a/engines/ultima/ultima8/graphics/fonts/tt_font.cpp b/engines/ultima/ultima8/graphics/fonts/tt_font.cpp
index 27fbb81..ff22477 100644
--- a/engines/ultima/ultima8/graphics/fonts/tt_font.cpp
+++ b/engines/ultima/ultima8/graphics/fonts/tt_font.cpp
@@ -37,7 +37,7 @@
namespace Ultima {
namespace Ultima8 {
-DEFINE_RUNTIME_CLASSTYPE_CODE(TTFont, Pentagram::Font)
+DEFINE_RUNTIME_CLASSTYPE_CODE(TTFont, Font)
// various unicode characters which look like small black circles
static const uint16 BULLETS[] = { 0x2022, 0x30FB, 0x25CF, 0 };
diff --git a/engines/ultima/ultima8/graphics/fonts/tt_font.h b/engines/ultima/ultima8/graphics/fonts/tt_font.h
index 6961f53..e2af335 100644
--- a/engines/ultima/ultima8/graphics/fonts/tt_font.h
+++ b/engines/ultima/ultima8/graphics/fonts/tt_font.h
@@ -30,7 +30,7 @@
namespace Ultima {
namespace Ultima8 {
-class TTFont : public Pentagram::Font {
+class TTFont : public Font {
public:
TTFont(Graphics::Font *font, uint32 rgb, int bordersize,
bool antiAliased, bool SJIS);
diff --git a/engines/ultima/ultima8/graphics/gump_shape_archive.cpp b/engines/ultima/ultima8/graphics/gump_shape_archive.cpp
index 00448cb..0ad4d97 100644
--- a/engines/ultima/ultima8/graphics/gump_shape_archive.cpp
+++ b/engines/ultima/ultima8/graphics/gump_shape_archive.cpp
@@ -46,11 +46,11 @@ void GumpShapeArchive::loadGumpage(IDataSource *ds) {
y = static_cast<int16>(ds->read2());
w = static_cast<int16>(ds->read2()) - x;
h = static_cast<int16>(ds->read2()) - y;
- gumpItemArea[i] = new Pentagram::Rect(x, y, w, h);
+ gumpItemArea[i] = new Rect(x, y, w, h);
}
}
-Pentagram::Rect *GumpShapeArchive::getGumpItemArea(uint32 shapenum) {
+Rect *GumpShapeArchive::getGumpItemArea(uint32 shapenum) {
if (shapenum >= gumpItemArea.size()) return 0;
return gumpItemArea[shapenum];
}
diff --git a/engines/ultima/ultima8/graphics/gump_shape_archive.h b/engines/ultima/ultima8/graphics/gump_shape_archive.h
index bc103af..5e91bec 100644
--- a/engines/ultima/ultima8/graphics/gump_shape_archive.h
+++ b/engines/ultima/ultima8/graphics/gump_shape_archive.h
@@ -28,35 +28,34 @@
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
+
struct Rect;
-}
class GumpShapeArchive : public ShapeArchive {
public:
ENABLE_RUNTIME_CLASSTYPE()
- GumpShapeArchive(uint16 id_, Pentagram::Palette *pal_ = 0,
+ GumpShapeArchive(uint16 id_, Palette *pal_ = 0,
const ConvertShapeFormat *format_ = 0)
: ShapeArchive(id_, pal_, format_) { }
- GumpShapeArchive(ArchiveFile *af, uint16 id_, Pentagram::Palette *pal_ = 0,
+ GumpShapeArchive(ArchiveFile *af, uint16 id_, Palette *pal_ = 0,
const ConvertShapeFormat *format_ = 0)
: ShapeArchive(af, id_, pal_, format_) { }
- GumpShapeArchive(IDataSource *ds, uint16 id_, Pentagram::Palette *pal_ = 0,
+ GumpShapeArchive(IDataSource *ds, uint16 id_, Palette *pal_ = 0,
const ConvertShapeFormat *format_ = 0)
: ShapeArchive(ds, id_, pal_, format_) { }
GumpShapeArchive(const Std::string &path, uint16 id_,
- Pentagram::Palette *pal_ = 0,
+ Palette *pal_ = 0,
const ConvertShapeFormat *format_ = 0)
: ShapeArchive(path, id_, pal_, format_) { }
virtual ~GumpShapeArchive();
void loadGumpage(IDataSource *ds);
- Pentagram::Rect *getGumpItemArea(uint32 shapenum);
+ Rect *getGumpItemArea(uint32 shapenum);
protected:
- Std::vector<Pentagram::Rect *> gumpItemArea;
+ Std::vector<Rect *> gumpItemArea;
};
} // End of namespace Ultima8
diff --git a/engines/ultima/ultima8/graphics/main_shape_archive.h b/engines/ultima/ultima8/graphics/main_shape_archive.h
index 5abdace..cee9355 100644
--- a/engines/ultima/ultima8/graphics/main_shape_archive.h
+++ b/engines/ultima/ultima8/graphics/main_shape_archive.h
@@ -39,17 +39,17 @@ class MainShapeArchive : public ShapeArchive {
public:
ENABLE_RUNTIME_CLASSTYPE()
- MainShapeArchive(uint16 id_, Pentagram::Palette *pal_ = 0,
+ MainShapeArchive(uint16 id_, Palette *pal_ = 0,
const ConvertShapeFormat *format_ = 0)
: ShapeArchive(id_, pal_, format_), typeFlags(0), animdat(0) { }
- MainShapeArchive(ArchiveFile *af, uint16 id_, Pentagram::Palette *pal_ = 0,
+ MainShapeArchive(ArchiveFile *af, uint16 id_, Palette *pal_ = 0,
const ConvertShapeFormat *format_ = 0)
: ShapeArchive(af, id_, pal_, format_), typeFlags(0), animdat(0) { }
- MainShapeArchive(IDataSource *ds, uint16 id_, Pentagram::Palette *pal_ = 0,
+ MainShapeArchive(IDataSource *ds, uint16 id_, Palette *pal_ = 0,
const ConvertShapeFormat *format_ = 0)
: ShapeArchive(ds, id_, pal_, format_), typeFlags(0), animdat(0) { }
MainShapeArchive(const Std::string &path, uint16 id_,
- Pentagram::Palette *pal_ = 0,
+ Palette *pal_ = 0,
const ConvertShapeFormat *format_ = 0)
: ShapeArchive(path, id_, pal_, format_), typeFlags(0), animdat(0) { }
diff --git a/engines/ultima/ultima8/graphics/palette.cpp b/engines/ultima/ultima8/graphics/palette.cpp
index 013f128..0e843ef 100644
--- a/engines/ultima/ultima8/graphics/palette.cpp
+++ b/engines/ultima/ultima8/graphics/palette.cpp
@@ -27,7 +27,6 @@
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
void Palette::load(IDataSource &ds, IDataSource &xformds) {
load(ds);
@@ -66,6 +65,5 @@ void Palette::load(IDataSource &ds) {
transform = Transform_None;
}
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/graphics/palette.h b/engines/ultima/ultima8/graphics/palette.h
index 2014fb9..e94a627 100644
--- a/engines/ultima/ultima8/graphics/palette.h
+++ b/engines/ultima/ultima8/graphics/palette.h
@@ -28,8 +28,6 @@ namespace Ultima8 {
class IDataSource;
-namespace Pentagram {
-
enum PalTransforms {
// Normal untransformed palette
Transform_None = 0,
@@ -89,7 +87,6 @@ struct Palette {
PalTransforms transform;
};
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/graphics/palette_fader_process.cpp b/engines/ultima/ultima8/graphics/palette_fader_process.cpp
index 94fb590..8929052 100644
--- a/engines/ultima/ultima8/graphics/palette_fader_process.cpp
+++ b/engines/ultima/ultima8/graphics/palette_fader_process.cpp
@@ -43,11 +43,11 @@ PaletteFaderProcess::PaletteFaderProcess()
}
-PaletteFaderProcess::PaletteFaderProcess(Pentagram::PalTransforms trans,
+PaletteFaderProcess::PaletteFaderProcess(PalTransforms trans,
int priority_, int frames) : priority(priority_),
counter(frames), max_counter(frames) {
PaletteManager *pm = PaletteManager::get_instance();
- Pentagram::Palette *pal = pm->getPalette(PaletteManager::Pal_Game);
+ Palette *pal = pm->getPalette(PaletteManager::Pal_Game);
for (int i = 0; i < 12; i++) old_matrix[i] = pal->matrix[i];
pm->getTransformMatrix(new_matrix, trans);
pal->transform = trans;
@@ -57,7 +57,7 @@ PaletteFaderProcess::PaletteFaderProcess(uint32 col32, bool from,
int priority_, int frames, bool current) : priority(priority_),
counter(frames), max_counter(frames) {
PaletteManager *pm = PaletteManager::get_instance();
- Pentagram::Palette *pal = pm->getPalette(PaletteManager::Pal_Game);
+ Palette *pal = pm->getPalette(PaletteManager::Pal_Game);
if (!from) {
if (current)
for (int i = 0; i < 12; i++) old_matrix[i] = pal->matrix[i];
@@ -141,7 +141,7 @@ uint32 PaletteFaderProcess::I_fadeToPaletteTransform(const uint8 *args,
if (fader && fader->priority > priority) return 0;
else if (fader) fader->terminate();
- fader = new PaletteFaderProcess(static_cast<Pentagram::PalTransforms>(transform),
+ fader = new PaletteFaderProcess(static_cast<PalTransforms>(transform),
priority, 45);
return Kernel::get_instance()->addProcess(fader);
diff --git a/engines/ultima/ultima8/graphics/palette_fader_process.h b/engines/ultima/ultima8/graphics/palette_fader_process.h
index 80158db..afab67c 100644
--- a/engines/ultima/ultima8/graphics/palette_fader_process.h
+++ b/engines/ultima/ultima8/graphics/palette_fader_process.h
@@ -43,7 +43,7 @@ public:
// p_dynamic_class stuff
ENABLE_RUNTIME_CLASSTYPE()
PaletteFaderProcess();
- PaletteFaderProcess(Pentagram::PalTransforms trans, int priority, int frames);
+ PaletteFaderProcess(PalTransforms trans, int priority, int frames);
PaletteFaderProcess(uint32 rgba, bool from, int priority, int frames, bool current);
PaletteFaderProcess(int16 from[12], int16 to[12], int priority, int frames);
virtual ~PaletteFaderProcess(void);
diff --git a/engines/ultima/ultima8/graphics/palette_manager.cpp b/engines/ultima/ultima8/graphics/palette_manager.cpp
index 9e12ef6..2e53b17 100644
--- a/engines/ultima/ultima8/graphics/palette_manager.cpp
+++ b/engines/ultima/ultima8/graphics/palette_manager.cpp
@@ -55,7 +55,7 @@ void PaletteManager::reset() {
}
void PaletteManager::updatedFont(PalIndex index) {
- Pentagram::Palette *pal = getPalette(index);
+ Palette *pal = getPalette(index);
if (pal)
rendersurface->CreateNativePalette(pal); // convert to native format
}
@@ -65,12 +65,12 @@ void PaletteManager::resetTransforms() {
con->Print(MM_INFO, "Resetting Palette Transforms...\n");
int16 matrix[12];
- getTransformMatrix(matrix, Pentagram::Transform_None);
+ getTransformMatrix(matrix, Transform_None);
for (unsigned int i = 0; i < palettes.size(); ++i) {
- Pentagram::Palette *pal = palettes[i];
+ Palette *pal = palettes[i];
if (!pal) continue;
- pal->transform = Pentagram::Transform_None;
+ pal->transform = Transform_None;
for (int j = 0; j < 12; j++) pal->matrix[j] = matrix[j];
rendersurface->CreateNativePalette(pal); // convert to native format
}
@@ -93,7 +93,7 @@ void PaletteManager::load(PalIndex index, IDataSource &ds, IDataSource &xformds)
if (palettes[index])
delete palettes[index];
- Pentagram::Palette *pal = new Pentagram::Palette;
+ Palette *pal = new Palette;
pal->load(ds, xformds);
rendersurface->CreateNativePalette(pal); // convert to native format
@@ -107,7 +107,7 @@ void PaletteManager::load(PalIndex index, IDataSource &ds) {
if (palettes[index])
delete palettes[index];
- Pentagram::Palette *pal = new Pentagram::Palette;
+ Palette *pal = new Palette;
pal->load(ds);
rendersurface->CreateNativePalette(pal); // convert to native format
@@ -115,10 +115,10 @@ void PaletteManager::load(PalIndex index, IDataSource &ds) {
}
void PaletteManager::duplicate(PalIndex src, PalIndex dest) {
- Pentagram::Palette *newpal = getPalette(dest);
+ Palette *newpal = getPalette(dest);
if (!newpal)
- newpal = new Pentagram::Palette;
- Pentagram::Palette *srcpal = getPalette(src);
+ newpal = new Palette;
+ Palette *srcpal = getPalette(src);
if (srcpal)
*newpal = *srcpal;
@@ -128,7 +128,7 @@ void PaletteManager::duplicate(PalIndex src, PalIndex dest) {
palettes[dest] = newpal;
}
-Pentagram::Palette *PaletteManager::getPalette(PalIndex index) {
+Palette *PaletteManager::getPalette(PalIndex index) {
if (static_cast<unsigned int>(index) >= palettes.size())
return 0;
@@ -136,7 +136,7 @@ Pentagram::Palette *PaletteManager::getPalette(PalIndex index) {
}
void PaletteManager::transformPalette(PalIndex index, int16 matrix[12]) {
- Pentagram::Palette *pal = getPalette(index);
+ Palette *pal = getPalette(index);
if (!pal) return;
@@ -145,20 +145,20 @@ void PaletteManager::transformPalette(PalIndex index, int16 matrix[12]) {
}
void PaletteManager::untransformPalette(PalIndex index) {
- Pentagram::Palette *pal = getPalette(index);
+ Palette *pal = getPalette(index);
if (!pal) return;
- pal->transform = Pentagram::Transform_None;
+ pal->transform = Transform_None;
int16 matrix[12];
- getTransformMatrix(matrix, Pentagram::Transform_None);
+ getTransformMatrix(matrix, Transform_None);
transformPalette(index, matrix);
}
-void PaletteManager::getTransformMatrix(int16 matrix[12], Pentagram::PalTransforms trans) {
+void PaletteManager::getTransformMatrix(int16 matrix[12], PalTransforms trans) {
switch (trans) {
// Normal untransformed palette
- case Pentagram::Transform_None: {
+ case Transform_None: {
matrix[0] = 0x800;
matrix[1] = 0;
matrix[2] = 0;
@@ -175,7 +175,7 @@ void PaletteManager::getTransformMatrix(int16 matrix[12], Pentagram::PalTransfor
break;
// O[i] = I[r]*0.375 + I[g]*0.5 + I[b]*0.125;
- case Pentagram::Transform_Greyscale: {
+ case Transform_Greyscale: {
for (int i = 0; i < 3; i++) {
matrix[i * 4 + 0] = 0x0300;
matrix[i * 4 + 1] = 0x0400;
@@ -186,7 +186,7 @@ void PaletteManager::getTransformMatrix(int16 matrix[12], Pentagram::PalTransfor
break;
// O[r] = 0;
- case Pentagram::Transform_NoRed: {
+ case Transform_NoRed: {
matrix[0] = 0;
matrix[1] = 0;
matrix[2] = 0;
@@ -203,7 +203,7 @@ void PaletteManager::getTransformMatrix(int16 matrix[12], Pentagram::PalTransfor
break;
// O[i] = (I[i] + Grey)*0.25 + 0.1875;
- case Pentagram::Transform_RainStorm: {
+ case Transform_RainStorm: {
for (int i = 0; i < 3; i++) {
matrix[i * 4 + 0] = (0x0300 * 0x0200) >> 11;
matrix[i * 4 + 1] = (0x0400 * 0x0200) >> 11;
@@ -219,7 +219,7 @@ void PaletteManager::getTransformMatrix(int16 matrix[12], Pentagram::PalTransfor
// O[r] = I[r]*0.5 + Grey*0.5 + 0.1875;
// O[g] = I[g]*0.5 + Grey*0.25;
// O[b] = I[b]*0.5;
- case Pentagram::Transform_FireStorm: {
+ case Transform_FireStorm: {
// O[r] = I[r]*0.5 + Grey*0.5 + 0.1875;
matrix[0] = ((0x0300 * 0x0400) >> 11) + 0x0400;
matrix[1] = (0x0400 * 0x0400) >> 11;
@@ -241,7 +241,7 @@ void PaletteManager::getTransformMatrix(int16 matrix[12], Pentagram::PalTransfor
break;
// O[i] = I[i]*2 -Grey;
- case Pentagram::Transform_Saturate: {
+ case Transform_Saturate: {
for (int i = 0; i < 3; i++) {
matrix[i * 4 + 0] = -0x0300;
matrix[i * 4 + 1] = -0x0400;
@@ -253,7 +253,7 @@ void PaletteManager::getTransformMatrix(int16 matrix[12], Pentagram::PalTransfor
break;
// O[b] = I[r]; O[r] = I[g]; O[g] = I[b];
- case Pentagram::Transform_BRG: {
+ case Transform_BRG: {
matrix[0] = 0;
matrix[1] = 0x800;
matrix[2] = 0;
@@ -270,7 +270,7 @@ void PaletteManager::getTransformMatrix(int16 matrix[12], Pentagram::PalTransfor
break;
// O[g] = I[r]; O[b] = I[g]; O[r] = I[b];
- case Pentagram::Transform_GBR: {
+ case Transform_GBR: {
matrix[0] = 0;
matrix[1] = 0;
matrix[2] = 0x800;
diff --git a/engines/ultima/ultima8/graphics/palette_manager.h b/engines/ultima/ultima8/graphics/palette_manager.h
index 60b5f59..356ad25 100644
--- a/engines/ultima/ultima8/graphics/palette_manager.h
+++ b/engines/ultima/ultima8/graphics/palette_manager.h
@@ -49,7 +49,7 @@ public:
void load(PalIndex index, IDataSource &ds, IDataSource &xformds);
void load(PalIndex index, IDataSource &ds);
- Pentagram::Palette *getPalette(PalIndex index);
+ Palette *getPalette(PalIndex index);
void duplicate(PalIndex src, PalIndex dest);
@@ -64,7 +64,7 @@ public:
// Get a TransformMatrix from a PalTransforms value (-4.11 fixed)
static void getTransformMatrix(int16 matrix[12],
- Pentagram::PalTransforms trans);
+ PalTransforms trans);
// Create a custom Transform Matrix from RGBA col32. (-4.11 fixed)
// Alpha will set how much of original palette to keep. 0 = keep none
@@ -80,7 +80,7 @@ public:
void resetTransforms();
private:
- Std::vector<Pentagram::Palette *> palettes;
+ Std::vector<Palette *> palettes;
RenderSurface *rendersurface;
static PaletteManager *palettemanager;
diff --git a/engines/ultima/ultima8/graphics/point_scaler.cpp b/engines/ultima/ultima8/graphics/point_scaler.cpp
index 8cfb999..bee8048 100644
--- a/engines/ultima/ultima8/graphics/point_scaler.cpp
+++ b/engines/ultima/ultima8/graphics/point_scaler.cpp
@@ -26,7 +26,6 @@
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
// Very very simple point scaler
template<class uintX, class Manip, class uintS = uintX> class PointScalerInternal {
@@ -302,6 +301,5 @@ bool PointScaler::ScaleArbitrary() const {
return true;
}
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/graphics/point_scaler.h b/engines/ultima/ultima8/graphics/point_scaler.h
index ffaabd8..e338ca6 100644
--- a/engines/ultima/ultima8/graphics/point_scaler.h
+++ b/engines/ultima/ultima8/graphics/point_scaler.h
@@ -27,7 +27,6 @@
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
class PointScaler : public Scaler {
public:
@@ -37,7 +36,6 @@ public:
virtual bool ScaleArbitrary() const; //< supports arbitrary scaling of any degree
};
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/graphics/render_surface.h b/engines/ultima/ultima8/graphics/render_surface.h
index 74ad68f..7c67d01 100644
--- a/engines/ultima/ultima8/graphics/render_surface.h
+++ b/engines/ultima/ultima8/graphics/render_surface.h
@@ -35,11 +35,9 @@ class Shape;
class ShapeFont;
struct FixedWidthFont;
-namespace Pentagram {
struct Palette;
struct Rect;
class Scaler;
-}
#define UNPACK_RGB8(pix,r,g,b) { r = (((pix)&RenderSurface::format.r_mask)>>RenderSurface::format.r_shift)<<RenderSurface::format.r_loss; g = (((pix)&RenderSurface::format.g_mask)>>RenderSurface::format.g_shift)<<RenderSurface::format.g_loss; b = (((pix)&RenderSurface::format.b_mask)>>RenderSurface::format.b_shift)<<RenderSurface::format.b_loss; }
#define PACK_RGB8(r,g,b) ((((r)>>RenderSurface::format.r_loss)<<RenderSurface::format.r_shift) | (((g)>>RenderSurface::format.g_loss)<<RenderSurface::format.g_shift) | (((b)>>RenderSurface::format.b_loss)<<RenderSurface::format.b_shift))
@@ -116,16 +114,16 @@ public:
virtual void GetOrigin(int32 &x, int32 &y) const = 0;
//! Get the Surface Dimensions
- virtual void GetSurfaceDims(Pentagram::Rect &) const = 0;
+ virtual void GetSurfaceDims(Rect &) const = 0;
//! Get Clipping Rectangle
- virtual void GetClippingRect(Pentagram::Rect &) const = 0;
+ virtual void GetClippingRect(Rect &) const = 0;
//! Set Clipping Rectangle
- virtual void SetClippingRect(const Pentagram::Rect &) = 0;
+ virtual void SetClippingRect(const Rect &) = 0;
//! Check Clipped. -1 if off screen, 0 if not clipped, 1 if clipped
- virtual int16 CheckClipped(const Pentagram::Rect &) const = 0;
+ virtual int16 CheckClipped(const Rect &) const = 0;
//! Flip the surface
virtual void SetFlipped(bool flipped) = 0;
@@ -151,7 +149,7 @@ public:
// Get The Surface Palette
// TODO: virtual void GetPalette(uint8 palette[768]) = 0;
- virtual void CreateNativePalette(Pentagram::Palette *palette) = 0;
+ virtual void CreateNativePalette(Palette *palette) = 0;
//
@@ -251,7 +249,7 @@ public:
virtual void StretchBlit(Texture *, int32 sx, int32 sy, int32 sw, int32 sh, int32 dx, int32 dy, int32 dw, int32 dh, bool clampedges = false) = 0;
//! Blit a region from a Texture using a scaler
- virtual bool ScalerBlit(Texture *, int32 sx, int32 sy, int32 sw, int32 sh, int32 dx, int32 dy, int32 dw, int32 dh, const Pentagram::Scaler *, bool clampedges = false) = 0;
+ virtual bool ScalerBlit(Texture *, int32 sx, int32 sy, int32 sw, int32 sh, int32 dx, int32 dy, int32 dw, int32 dh, const Scaler *, bool clampedges = false) = 0;
////////////////////////////////////////
diff --git a/engines/ultima/ultima8/graphics/scaler.h b/engines/ultima/ultima8/graphics/scaler.h
index 7417a56..4747406 100644
--- a/engines/ultima/ultima8/graphics/scaler.h
+++ b/engines/ultima/ultima8/graphics/scaler.h
@@ -28,7 +28,6 @@
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
/// Base Scaler class
class Scaler {
@@ -116,7 +115,6 @@ public:
virtual ~Scaler() { }
};
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/graphics/shape.h b/engines/ultima/ultima8/graphics/shape.h
index 2f49e49..9fa611f 100644
--- a/engines/ultima/ultima8/graphics/shape.h
+++ b/engines/ultima/ultima8/graphics/shape.h
@@ -30,10 +30,8 @@ namespace Ultima {
namespace Ultima8 {
class ShapeFrame;
-namespace Pentagram {
struct Palette;
struct Rect;
-}
struct ConvertShapeFormat;
class IDataSource;
@@ -46,10 +44,10 @@ public:
const uint16 flexId, const uint32 shapenum);
Shape(IDataSource *src, const ConvertShapeFormat *format);
virtual ~Shape();
- void setPalette(const Pentagram::Palette *pal) {
+ void setPalette(const Palette *pal) {
palette = pal;
}
- const Pentagram::Palette *getPalette() const {
+ const Palette *getPalette() const {
return palette;
}
@@ -91,7 +89,7 @@ protected:
Std::vector<ShapeFrame *> frames;
- const Pentagram::Palette *palette;
+ const Palette *palette;
const uint8 *data;
uint32 size;
diff --git a/engines/ultima/ultima8/graphics/shape_archive.cpp b/engines/ultima/ultima8/graphics/shape_archive.cpp
index 1193e2b..af87b24 100644
--- a/engines/ultima/ultima8/graphics/shape_archive.cpp
+++ b/engines/ultima/ultima8/graphics/shape_archive.cpp
@@ -30,7 +30,7 @@
namespace Ultima {
namespace Ultima8 {
-DEFINE_RUNTIME_CLASSTYPE_CODE(ShapeArchive, Pentagram::Archive)
+DEFINE_RUNTIME_CLASSTYPE_CODE(ShapeArchive, Archive)
ShapeArchive::~ShapeArchive() {
Archive::uncache();
diff --git a/engines/ultima/ultima8/graphics/shape_archive.h b/engines/ultima/ultima8/graphics/shape_archive.h
index 5b38bd6..47a1bc8 100644
--- a/engines/ultima/ultima8/graphics/shape_archive.h
+++ b/engines/ultima/ultima8/graphics/shape_archive.h
@@ -31,25 +31,23 @@ namespace Ultima8 {
class Shape;
struct ConvertShapeFormat;
-namespace Pentagram {
struct Palette;
-}
-class ShapeArchive : public Pentagram::Archive {
+class ShapeArchive : public Archive {
public:
ENABLE_RUNTIME_CLASSTYPE()
- ShapeArchive(uint16 id_, Pentagram::Palette *pal_ = 0,
+ ShapeArchive(uint16 id_, Palette *pal_ = 0,
const ConvertShapeFormat *format_ = 0)
: Archive(), id(id_), format(format_), palette(pal_) { }
- ShapeArchive(ArchiveFile *af, uint16 id_, Pentagram::Palette *pal_ = 0,
+ ShapeArchive(ArchiveFile *af, uint16 id_, Palette *pal_ = 0,
const ConvertShapeFormat *format_ = 0)
: Archive(af), id(id_), format(format_), palette(pal_) { }
- ShapeArchive(IDataSource *ds, uint16 id_, Pentagram::Palette *pal_ = 0,
+ ShapeArchive(IDataSource *ds, uint16 id_, Palette *pal_ = 0,
const ConvertShapeFormat *format_ = 0)
: Archive(ds), id(id_), format(format_), palette(pal_) { }
ShapeArchive(const Std::string &path, uint16 id_,
- Pentagram::Palette *pal_ = 0,
+ Palette *pal_ = 0,
const ConvertShapeFormat *format_ = 0)
: Archive(path), id(id_), format(format_), palette(pal_) { }
@@ -64,7 +62,7 @@ public:
protected:
uint16 id;
const ConvertShapeFormat *format;
- Pentagram::Palette *palette;
+ Palette *palette;
Std::vector<Shape *> shapes;
};
diff --git a/engines/ultima/ultima8/graphics/skf_player.cpp b/engines/ultima/ultima8/graphics/skf_player.cpp
index adff566..621c95f 100644
--- a/engines/ultima/ultima8/graphics/skf_player.cpp
+++ b/engines/ultima/ultima8/graphics/skf_player.cpp
@@ -167,7 +167,7 @@ void SKFPlayer::run() {
return;
}
- Pentagram::Font *redfont;
+ Font *redfont;
redfont = FontManager::get_instance()->getGameFont(6, true);
MusicProcess *musicproc = MusicProcess::get_instance();
@@ -225,10 +225,10 @@ void SKFPlayer::run() {
if (audioproc) {
uint8 *buf = skf->get_object(events[curevent]->data);
uint32 bufsize = skf->get_size(events[curevent]->data);
- Pentagram::AudioSample *s;
+ AudioSample *s;
uint32 rate = buf[6] + (buf[7] << 8);
bool stereo = (buf[8] == 2);
- s = new Pentagram::RawAudioSample(buf + 34, bufsize - 34,
+ s = new RawAudioSample(buf + 34, bufsize - 34,
rate, true, stereo);
audioproc->playSample(s, 0x60, 0);
// FIXME: memory leak! (sample is never deleted)
@@ -244,7 +244,7 @@ void SKFPlayer::run() {
subtitley = textbuf[4] + (textbuf[5] << 8);
unsigned int remaining;
subs = redfont->renderText(subtitle, remaining, 200, 0,
- Pentagram::Font::TEXT_CENTER);
+ Font::TEXT_CENTER);
}
delete textbuf;
@@ -300,7 +300,7 @@ void SKFPlayer::run() {
if (objecttype == 2) {
object->seek(0);
Shape *shape = new Shape(object, &U8SKFShapeFormat);
- Pentagram::Palette *pal = palman->getPalette(PaletteManager::Pal_Movie);
+ Palette *pal = palman->getPalette(PaletteManager::Pal_Movie);
shape->setPalette(pal);
buffer->BeginPainting();
buffer->Paint(shape, 0, 0, 0);
diff --git a/engines/ultima/ultima8/graphics/skf_player.h b/engines/ultima/ultima8/graphics/skf_player.h
index a8aa416..b9aef61 100644
--- a/engines/ultima/ultima8/graphics/skf_player.h
+++ b/engines/ultima/ultima8/graphics/skf_player.h
@@ -33,9 +33,7 @@ class RawArchive;
class RenderSurface;
class RenderedText;
class IDataSource;
-namespace Pentagram {
struct Palette;
-}
class SKFPlayer {
public:
diff --git a/engines/ultima/ultima8/graphics/soft_render_surface.cpp b/engines/ultima/ultima8/graphics/soft_render_surface.cpp
index e709d33..6183dd4 100644
--- a/engines/ultima/ultima8/graphics/soft_render_surface.cpp
+++ b/engines/ultima/ultima8/graphics/soft_render_surface.cpp
@@ -143,7 +143,7 @@ template<> void SoftRenderSurface<uint16>::Fill32(uint32 rgb, int32 sx, int32 sy
rgb = PACK_RGB8((rgb >> 16) & 0xFF , (rgb >> 8) & 0xFF , rgb & 0xFF);
while (pixel != end) {
- Pentagram::memset_16(pixel, rgb, w);
+ memset_16(pixel, rgb, w);
pixel += pitch;
}
}
@@ -165,7 +165,7 @@ template<> void SoftRenderSurface<uint32>::Fill32(uint32 rgb, int32 sx, int32 sy
rgb = PACK_RGB8((rgb >> 16) & 0xFF , (rgb >> 8) & 0xFF , rgb & 0xFF);
while (pixel != end) {
- Pentagram::memset_32(pixel, rgb, w);
+ memset_32(pixel, rgb, w);
pixel += pitch;
}
}
@@ -732,12 +732,12 @@ template<class uintX> void SoftRenderSurface<uintX>::StretchBlit(Texture *textur
}
//
-// bool SoftRenderSurface::ScalerBlit(Texture *texure, int32 sx, int32 sy, int32 sw, int32 sh, int32 dx, int32 dy, int32 dw, int32 dh, const Pentagram::Scaler *scaler, bool clampedges)
+// bool SoftRenderSurface::ScalerBlit(Texture *texure, int32 sx, int32 sy, int32 sw, int32 sh, int32 dx, int32 dy, int32 dw, int32 dh, const Scaler *scaler, bool clampedges)
//
// Desc: Blit a region from a Texture using a scaler
//
//
-template<class uintX> bool SoftRenderSurface<uintX>::ScalerBlit(Texture *texture, int32 sx, int32 sy, int32 sw, int32 sh, int32 dx, int32 dy, int32 dw, int32 dh, const Pentagram::Scaler *scaler, bool clampedges) {
+template<class uintX> bool SoftRenderSurface<uintX>::ScalerBlit(Texture *texture, int32 sx, int32 sy, int32 sw, int32 sh, int32 dx, int32 dy, int32 dw, int32 dh, const Scaler *scaler, bool clampedges) {
// Nothing we can do
if ((sh <= 0) || (dh <= 0) || (sw <= 0) || (dw <= 0)) return false;
diff --git a/engines/ultima/ultima8/graphics/soft_render_surface.h b/engines/ultima/ultima8/graphics/soft_render_surface.h
index 123efbd..977c0be 100644
--- a/engines/ultima/ultima8/graphics/soft_render_surface.h
+++ b/engines/ultima/ultima8/graphics/soft_render_surface.h
@@ -148,7 +148,7 @@ public:
virtual void StretchBlit(Texture *, int32 sx, int32 sy, int32 sw, int32 sh, int32 dx, int32 dy, int32 dw, int32 dh, bool clampedges = false);
// Blit a region from a Texture using a scaler
- virtual bool ScalerBlit(Texture *, int32 sx, int32 sy, int32 sw, int32 sh, int32 dx, int32 dy, int32 dw, int32 dh, const Pentagram::Scaler *, bool clampedges = false);
+ virtual bool ScalerBlit(Texture *, int32 sx, int32 sy, int32 sw, int32 sh, int32 dx, int32 dy, int32 dw, int32 dh, const Scaler *, bool clampedges = false);
////////////////////////////////////////
// TODO: Add in Abstract 3d code Here //
diff --git a/engines/ultima/ultima8/graphics/type_flags.cpp b/engines/ultima/ultima8/graphics/type_flags.cpp
index b07d494..d3fae7b 100644
--- a/engines/ultima/ultima8/graphics/type_flags.cpp
+++ b/engines/ultima/ultima8/graphics/type_flags.cpp
@@ -176,11 +176,11 @@ void TypeFlags::loadWeaponInfo() {
ConfigFileManager *config = ConfigFileManager::get_instance();
// load weapons
- Std::vector<Pentagram::istring> weaponkeys;
+ Std::vector<istring> weaponkeys;
weaponkeys = config->listSections("weapons", true);
- for (Std::vector<Pentagram::istring>::iterator iter = weaponkeys.begin();
+ for (Std::vector<istring>::iterator iter = weaponkeys.begin();
iter != weaponkeys.end(); ++iter) {
- Pentagram::istring k = *iter;
+ istring k = *iter;
WeaponInfo *wi = new WeaponInfo;
int val;
@@ -228,11 +228,11 @@ void TypeFlags::loadArmourInfo() {
MainShapeArchive *msf = GameData::get_instance()->getMainShapes();
// load armour
- Std::vector<Pentagram::istring> armourkeys;
+ Std::vector<istring> armourkeys;
armourkeys = config->listSections("armour", true);
- for (Std::vector<Pentagram::istring>::iterator iter = armourkeys.begin();
+ for (Std::vector<istring>::iterator iter = armourkeys.begin();
iter != armourkeys.end(); ++iter) {
- Pentagram::istring k = *iter;
+ istring k = *iter;
ArmourInfo ai;
int val;
@@ -285,11 +285,11 @@ void TypeFlags::loadMonsterInfo() {
treasureLoader.loadDefaults();
// load monsters
- Std::vector<Pentagram::istring> monsterkeys;
+ Std::vector<istring> monsterkeys;
monsterkeys = config->listSections("monsters", true);
- for (Std::vector<Pentagram::istring>::iterator iter = monsterkeys.begin();
+ for (Std::vector<istring>::iterator iter = monsterkeys.begin();
iter != monsterkeys.end(); ++iter) {
- Pentagram::istring k = *iter;
+ istring k = *iter;
MonsterInfo *mi = new MonsterInfo;
int val;
diff --git a/engines/ultima/ultima8/gumps/ask_gump.cpp b/engines/ultima/ultima8/gumps/ask_gump.cpp
index aded221..36451b6 100644
--- a/engines/ultima/ultima8/gumps/ask_gump.cpp
+++ b/engines/ultima/ultima8/gumps/ask_gump.cpp
@@ -85,7 +85,7 @@ void AskGump::InitGump(Gump *newparent, bool take_focus) {
child->InitGump(this);
child->SetIndex(i);
- Pentagram::Rect cd;
+ Rect cd;
child->GetDims(cd);
if (i + 1 < answers->getSize())
cd.h += child->getVlead();
@@ -151,7 +151,7 @@ bool AskGump::loadData(IDataSource *ids, uint32 version) {
if (!child) return false;
- Pentagram::Rect cd;
+ Rect cd;
child->GetDims(cd);
if (px + cd.w > 160 && px != 0) {
diff --git a/engines/ultima/ultima8/gumps/bark_gump.cpp b/engines/ultima/ultima8/gumps/bark_gump.cpp
index ec214e5..52e2239 100644
--- a/engines/ultima/ultima8/gumps/bark_gump.cpp
+++ b/engines/ultima/ultima8/gumps/bark_gump.cpp
@@ -92,7 +92,7 @@ void BarkGump::InitGump(Gump *newparent, bool take_focus) {
// We're playing speech, so need to sync the text with the speech.
// First we count the total height of all text blocks.
- Pentagram::Rect d;
+ Rect d;
widget->GetDims(d);
totaltextheight = d.h;
while (widget->setupNextText()) {
@@ -104,7 +104,7 @@ void BarkGump::InitGump(Gump *newparent, bool take_focus) {
}
// This is just a hack
- Pentagram::Rect d;
+ Rect d;
widget->GetDims(d);
if (speechlength && totaltextheight) {
counter = (d.h * speechlength) / totaltextheight;
@@ -123,7 +123,7 @@ bool BarkGump::NextText() {
assert(widget);
if (widget->setupNextText()) {
// This is just a hack
- Pentagram::Rect d;
+ Rect d;
widget->GetDims(d);
if (speechlength && totaltextheight) {
counter = (d.h * speechlength) / totaltextheight;
@@ -219,7 +219,7 @@ bool BarkGump::loadData(IDataSource *ids, uint32 version) {
SettingManager::get_instance()->get("textdelay", textdelay);
// This is just a hack
- Pentagram::Rect d;
+ Rect d;
widget->GetDims(d);
counter = d.h * textdelay;
dims.h = d.h;
diff --git a/engines/ultima/ultima8/gumps/bind_gump.cpp b/engines/ultima/ultima8/gumps/bind_gump.cpp
index 9d1f997..5dd28e3 100644
--- a/engines/ultima/ultima8/gumps/bind_gump.cpp
+++ b/engines/ultima/ultima8/gumps/bind_gump.cpp
@@ -38,7 +38,7 @@ namespace Ultima8 {
DEFINE_RUNTIME_CLASSTYPE_CODE(BindGump, ModalGump)
-BindGump::BindGump(Pentagram::istring *b, Gump *g): ModalGump(0, 0, 160, 80), binding(b), invoker(g) {
+BindGump::BindGump(istring *b, Gump *g): ModalGump(0, 0, 160, 80), binding(b), invoker(g) {
}
BindGump::~BindGump() {
@@ -50,7 +50,7 @@ void BindGump::InitGump(Gump *newparent, bool take_focus) {
//! English ! - TODO: Externalize string.
Std::string bindtext = "Press any key or button.\n\nPress ESCAPE to cancel\nor BACKSPACE to clear";
Gump *widget = new TextWidget(0, 0, bindtext, true, 6, 0, 0,
- Pentagram::Font::TEXT_CENTER);
+ Font::TEXT_CENTER);
widget->InitGump(this);
widget->setRelativePosition(TOP_CENTER, 0, 8);
}
@@ -69,7 +69,7 @@ bool BindGump::OnKeyDown(int key, int mod) {
if (key == Common::KEYCODE_BACKSPACE) {
hidmanager->unbind(*binding);
} else {
-// Pentagram::istring control = SDL_GetKeyName(static_cast<SDLKey>(key));
+// istring control = SDL_GetKeyName(static_cast<SDLKey>(key));
// hidmanager->bind(control, *binding);
}
if (invoker)
@@ -80,7 +80,7 @@ bool BindGump::OnKeyDown(int key, int mod) {
}
Gump *BindGump::OnMouseDown(int button, int32 mx, int32 my) {
- //Pentagram::istring control = GetMouseButtonName(static_cast<MouseButton>(button));
+ //istring control = GetMouseButtonName(static_cast<MouseButton>(button));
// HIDManager * hidmanager = HIDManager::get_instance();
// if (binding)
// hidmanager->bind(control, *binding);
diff --git a/engines/ultima/ultima8/gumps/bind_gump.h b/engines/ultima/ultima8/gumps/bind_gump.h
index d01f47c..32ba568 100644
--- a/engines/ultima/ultima8/gumps/bind_gump.h
+++ b/engines/ultima/ultima8/gumps/bind_gump.h
@@ -35,7 +35,7 @@ class BindGump : public ModalGump {
public:
ENABLE_RUNTIME_CLASSTYPE()
- BindGump(Pentagram::istring *b, Gump *g);
+ BindGump(istring *b, Gump *g);
virtual ~BindGump(void);
// Init the gump, call after construction
@@ -55,7 +55,7 @@ public:
};
protected:
virtual void saveData(ODataSource *ods) override;
- Pentagram::istring *binding;
+ istring *binding;
Gump *invoker;
};
diff --git a/engines/ultima/ultima8/gumps/console_gump.cpp b/engines/ultima/ultima8/gumps/console_gump.cpp
index 6a0c255..5180fbe 100644
--- a/engines/ultima/ultima8/gumps/console_gump.cpp
+++ b/engines/ultima/ultima8/gumps/console_gump.cpp
@@ -34,8 +34,6 @@ namespace Ultima8 {
DEFINE_RUNTIME_CLASSTYPE_CODE(ConsoleGump, Gump)
-using Pentagram::istring;
-
ConsoleGump::ConsoleGump()
: Gump() {
con->AddConsoleCommand("ConsoleGump::toggle",
@@ -60,7 +58,7 @@ ConsoleGump::~ConsoleGump() {
void ConsoleGump::RenderSurfaceChanged() {
// Resize the desktop gump to match the RenderSurface
- Pentagram::Rect new_dims;
+ Rect new_dims;
parent->GetDims(new_dims);
con->CheckResize(new_dims.w);
dims.w = new_dims.w;
diff --git a/engines/ultima/ultima8/gumps/container_gump.h b/engines/ultima/ultima8/gumps/container_gump.h
index dad2fda..f1c755a 100644
--- a/engines/ultima/ultima8/gumps/container_gump.h
+++ b/engines/ultima/ultima8/gumps/container_gump.h
@@ -41,7 +41,7 @@ public:
uint32 _Flags = FLAG_DRAGGABLE, int32 layer = LAYER_NORMAL);
virtual ~ContainerGump(void);
- void setItemArea(Pentagram::Rect *itemarea_) {
+ void setItemArea(Rect *itemarea_) {
itemarea = *itemarea_;
}
@@ -83,7 +83,7 @@ protected:
void getItemCoords(Item *item, int32 &itemx, int32 &itemy);
- Pentagram::Rect itemarea;
+ Rect itemarea;
bool display_dragging;
uint32 dragging_shape;
diff --git a/engines/ultima/ultima8/gumps/controls_gump.cpp b/engines/ultima/ultima8/gumps/controls_gump.cpp
index e35f666..45fca30 100644
--- a/engines/ultima/ultima8/gumps/controls_gump.cpp
+++ b/engines/ultima/ultima8/gumps/controls_gump.cpp
@@ -49,7 +49,7 @@ public:
virtual void ChildNotify(Gump *child, uint32 message) override;
void init();
protected:
- Pentagram::istring bindingName;
+ istring bindingName;
Std::string displayedName;
Gump *button;
};
@@ -80,7 +80,7 @@ void ControlEntryGump::init() {
Std::vector<const char *> controls;
- Pentagram::Rect rect;
+ Rect rect;
button = new ButtonWidget(0, 0, displayedName, true, font, 0x80D000D0);
button->InitGump(this);
button->GetDims(rect);
@@ -136,7 +136,7 @@ void ControlsGump::InitGump(Gump *newparent, bool take_focus) {
}
void ControlsGump::addEntry(const char *binding, const char *name, int &x_, int &y_) {
- Pentagram::Rect rect;
+ Rect rect;
Gump *widget = new ControlEntryGump(x_, y_, dims.w - x_, binding, name);
widget->InitGump(this);
widget->GetDims(rect);
diff --git a/engines/ultima/ultima8/gumps/credits_gump.cpp b/engines/ultima/ultima8/gumps/credits_gump.cpp
index 26d2134..7b6766f 100644
--- a/engines/ultima/ultima8/gumps/credits_gump.cpp
+++ b/engines/ultima/ultima8/gumps/credits_gump.cpp
@@ -174,7 +174,7 @@ void CreditsGump::run() {
// scroll[nextblock]->Fill32(0xFFFFFFFF,0,0,256,5); // block marker
scrollheight[nextblock] = 0;
- Pentagram::Font *redfont, *yellowfont;
+ Font *redfont, *yellowfont;
redfont = FontManager::get_instance()->getGameFont(6, true);
yellowfont = FontManager::get_instance()->getGameFont(8, true);
@@ -208,7 +208,7 @@ void CreditsGump::run() {
unsigned int remaining;
nexttitle = redfont->renderText(titletext, remaining, 192, 0,
- Pentagram::Font::TEXT_CENTER);
+ Font::TEXT_CENTER);
if (!title) {
title = nexttitle;
@@ -222,8 +222,8 @@ void CreditsGump::run() {
int height = 0;
- Pentagram::Font *font = redfont;
- Pentagram::Font::TextAlign align = Pentagram::Font::TEXT_LEFT;
+ Font *font = redfont;
+ Font::TextAlign align = Font::TEXT_LEFT;
int indent = 0;
while (!line.empty()) {
@@ -237,15 +237,15 @@ void CreditsGump::run() {
switch (modifier) {
case '&':
font = yellowfont;
- align = Pentagram::Font::TEXT_CENTER;
+ align = Font::TEXT_CENTER;
break;
case '}':
font = redfont;
- align = Pentagram::Font::TEXT_CENTER;
+ align = Font::TEXT_CENTER;
break;
case '~':
font = yellowfont;
- align = Pentagram::Font::TEXT_LEFT;
+ align = Font::TEXT_LEFT;
indent = 32;
break;
case '@':
diff --git a/engines/ultima/ultima8/gumps/desktop_gump.cpp b/engines/ultima/ultima8/gumps/desktop_gump.cpp
index 593ba4a..ed907c4 100644
--- a/engines/ultima/ultima8/gumps/desktop_gump.cpp
+++ b/engines/ultima/ultima8/gumps/desktop_gump.cpp
@@ -102,7 +102,7 @@ void DesktopGump::StopDraggingChild(Gump *gump) {
void DesktopGump::RenderSurfaceChanged(RenderSurface *surf) {
// Resize the desktop gump to match the RenderSurface
- Pentagram::Rect new_dims;
+ Rect new_dims;
surf->GetSurfaceDims(new_dims);
dims.w = new_dims.w;
dims.h = new_dims.h;
@@ -112,7 +112,7 @@ void DesktopGump::RenderSurfaceChanged(RenderSurface *surf) {
void DesktopGump::RenderSurfaceChanged() {
// Resize the desktop gump to match the parent
- Pentagram::Rect new_dims;
+ Rect new_dims;
parent->GetDims(new_dims);
dims.w = new_dims.w;
dims.h = new_dims.h;
diff --git a/engines/ultima/ultima8/gumps/game_map_gump.cpp b/engines/ultima/ultima8/gumps/game_map_gump.cpp
index 021deb4..9d13d09 100644
--- a/engines/ultima/ultima8/gumps/game_map_gump.cpp
+++ b/engines/ultima/ultima8/gumps/game_map_gump.cpp
@@ -736,7 +736,7 @@ void GameMapGump::RenderSurfaceChanged() {
dims.y += dims.h / 2;
// Resize the desktop gump to match the parent
- Pentagram::Rect new_dims;
+ Rect new_dims;
parent->GetDims(new_dims);
dims.w = new_dims.w;
dims.h = new_dims.h;
diff --git a/engines/ultima/ultima8/gumps/gump.cpp b/engines/ultima/ultima8/gumps/gump.cpp
index f17e1e6..841c727 100644
--- a/engines/ultima/ultima8/gumps/gump.cpp
+++ b/engines/ultima/ultima8/gumps/gump.cpp
@@ -226,11 +226,11 @@ void Gump::Paint(RenderSurface *surf, int32 lerp_factor, bool scaled) {
surf->SetOrigin(ox + nx, oy + ny);
// Get Old Clipping Rect
- Pentagram::Rect old_rect;
+ Rect old_rect;
surf->GetClippingRect(old_rect);
// Set new clipping rect
- Pentagram::Rect new_rect = dims;
+ Rect new_rect = dims;
new_rect.Intersect(old_rect);
surf->SetClippingRect(new_rect);
@@ -250,7 +250,7 @@ void Gump::Paint(RenderSurface *surf, int32 lerp_factor, bool scaled) {
void Gump::PaintThis(RenderSurface *surf, int32 /*lerp_factor*/, bool /*scaled*/) {
if (shape) {
#if 0
- Pentagram::Rect sr;
+ Rect sr;
ShapeFrame *f = shape->getFrame(framenum);
sr.h = f->height;
sr.w = f->height;
@@ -297,13 +297,13 @@ void Gump::PaintCompositing(RenderSurface *surf, int32 lerp_factor,
surf->SetOrigin(0, 0);
// Get Old Clipping Rect
- Pentagram::Rect old_rect;
+ Rect old_rect;
surf->GetClippingRect(old_rect);
// Set new clipping rect
int32 cx = dims.x, cy = dims.y, cw = dims.w, ch = dims.h;
GumpRectToScreenSpace(cx, cy, cw, ch, ROUND_OUTSIDE);
- Pentagram::Rect new_rect(cx, cy, cw, ch);
+ Rect new_rect(cx, cy, cw, ch);
new_rect.Intersect(old_rect);
surf->SetClippingRect(new_rect);
@@ -359,7 +359,7 @@ Gump *Gump::FindGump(int mx, int my) {
void Gump::setRelativePosition(Gump::Position pos, int xoffset, int yoffset) {
if (parent) {
- Pentagram::Rect rect;
+ Rect rect;
parent->GetDims(rect);
switch (pos) {
diff --git a/engines/ultima/ultima8/gumps/gump.h b/engines/ultima/ultima8/gumps/gump.h
index 663a474..12fcdfb 100644
--- a/engines/ultima/ultima8/gumps/gump.h
+++ b/engines/ultima/ultima8/gumps/gump.h
@@ -53,7 +53,7 @@ protected:
int32 x, y; // Gump's position in parent.
// Always the upper left corner!
- Pentagram::Rect dims; // The dimensions/coord space of the gump
+ Rect dims; // The dimensions/coord space of the gump
uint32 flags; // Gump flags
int32 layer; // gump ordering layer
@@ -235,12 +235,12 @@ public:
//
//! Get the dims
- virtual void GetDims(Pentagram::Rect &d) {
+ virtual void GetDims(Rect &d) {
d = dims;
}
//! Set the dims
- virtual void SetDims(const Pentagram::Rect &d) {
+ virtual void SetDims(const Rect &d) {
dims = d;
}
diff --git a/engines/ultima/ultima8/gumps/item_relative_gump.cpp b/engines/ultima/ultima8/gumps/item_relative_gump.cpp
index 77b49b9..072ec3d 100644
--- a/engines/ultima/ultima8/gumps/item_relative_gump.cpp
+++ b/engines/ultima/ultima8/gumps/item_relative_gump.cpp
@@ -58,7 +58,7 @@ void ItemRelativeGump::InitGump(Gump *newparent, bool take_focus) {
void ItemRelativeGump::MoveOnScreen() {
assert(parent);
- Pentagram::Rect sd, gd;
+ Rect sd, gd;
parent->GetDims(sd);
// first move back to our desired location
diff --git a/engines/ultima/ultima8/gumps/menu_gump.cpp b/engines/ultima/ultima8/gumps/menu_gump.cpp
index 8ba6b0a..fd37cbc 100644
--- a/engines/ultima/ultima8/gumps/menu_gump.cpp
+++ b/engines/ultima/ultima8/gumps/menu_gump.cpp
@@ -137,7 +137,7 @@ void MenuGump::InitGump(Gump *newparent, bool take_focus) {
name = av->getName();
if (!name.empty()) {
- Pentagram::Rect rect;
+ Rect rect;
widget = new TextWidget(0, 0, name, true, 6);
widget->InitGump(this, false);
widget->GetDims(rect);
@@ -149,7 +149,7 @@ void MenuGump::InitGump(Gump *newparent, bool take_focus) {
widget->InitGump(this, false);
widget->Move(dims.w / 2 + 6, 10);
- Pentagram::Rect textdims;
+ Rect textdims;
widget->GetDims(textdims);
widget = new EditWidget(0, 0, "", true, 6, 110, 40, 15); // CONSTANTS!
diff --git a/engines/ultima/ultima8/gumps/message_box_gump.cpp b/engines/ultima/ultima8/gumps/message_box_gump.cpp
index e8d2625..608e223 100644
--- a/engines/ultima/ultima8/gumps/message_box_gump.cpp
+++ b/engines/ultima/ultima8/gumps/message_box_gump.cpp
@@ -73,7 +73,7 @@ void MessageBoxGump::InitGump(Gump *newparent, bool take_focus) {
ModalGump::InitGump(newparent, take_focus);
// work out sizes of the text
- Pentagram::Font *font = FontManager::get_instance()->getTTFont(0);
+ Font *font = FontManager::get_instance()->getTTFont(0);
int32 width, height;
unsigned int rem;
diff --git a/engines/ultima/ultima8/gumps/minimap_gump.cpp b/engines/ultima/ultima8/gumps/minimap_gump.cpp
index 64ed001..77d2a23 100644
--- a/engines/ultima/ultima8/gumps/minimap_gump.cpp
+++ b/engines/ultima/ultima8/gumps/minimap_gump.cpp
@@ -142,7 +142,7 @@ uint32 MiniMapGump::sampleAtPoint(int x_, int y_, CurrentMap *currentmap) {
ShapeFrame *frame = sh->getFrame(item->getFrame());
if (!frame) return 0;
- const Pentagram::Palette *pal = sh->getPalette();
+ const Palette *pal = sh->getPalette();
if (!pal) return 0;
// Screenspace bounding box bottom x_ coord (RNB x_ coord)
diff --git a/engines/ultima/ultima8/gumps/paperdoll_gump.cpp b/engines/ultima/ultima8/gumps/paperdoll_gump.cpp
index 9518be9..94aaa73 100644
--- a/engines/ultima/ultima8/gumps/paperdoll_gump.cpp
+++ b/engines/ultima/ultima8/gumps/paperdoll_gump.cpp
@@ -147,7 +147,7 @@ void PaperdollGump::PaintStat(RenderSurface *surf, unsigned int n,
Std::string text, int val) {
assert(n < 7); // constant!
- Pentagram::Font *font, *descfont;
+ Font *font, *descfont;
font = FontManager::get_instance()->getGameFont(statfont);
descfont = FontManager::get_instance()->getGameFont(statdescfont);
@@ -157,7 +157,7 @@ void PaperdollGump::PaintStat(RenderSurface *surf, unsigned int n,
if (!cached_text[2 * n])
cached_text[2 * n] = descfont->renderText(text, remaining,
statdescwidth, statheight,
- Pentagram::Font::TEXT_RIGHT);
+ Font::TEXT_RIGHT);
cached_text[2 * n]->draw(surf, statcoords[n].xd, statcoords[n].y);
if (!cached_text[2 * n + 1] || cached_val[n] != val) {
@@ -165,7 +165,7 @@ void PaperdollGump::PaintStat(RenderSurface *surf, unsigned int n,
sprintf(buf, "%d", val);
cached_text[2 * n + 1] = font->renderText(buf, remaining,
statwidth, statheight,
- Pentagram::Font::TEXT_RIGHT);
+ Font::TEXT_RIGHT);
cached_val[n] = val;
}
cached_text[2 * n + 1]->draw(surf, statcoords[n].x, statcoords[n].y);
@@ -396,9 +396,9 @@ void PaperdollGump::ChildNotify(Gump *child, uint32 message) {
gump->setRelativePosition(BOTTOM_RIGHT, -5, -5);
} else {
// check if it is off-screen. If so, move it back
- Pentagram::Rect rect;
+ Rect rect;
desktop->GetDims(rect);
- Pentagram::Rect sr;
+ Rect sr;
statsgump->GetDims(sr);
sr.x += 2;
sr.w -= 4;
diff --git a/engines/ultima/ultima8/gumps/paperdoll_gump.h b/engines/ultima/ultima8/gumps/paperdoll_gump.h
index ee27e96..468f81e 100644
--- a/engines/ultima/ultima8/gumps/paperdoll_gump.h
+++ b/engines/ultima/ultima8/gumps/paperdoll_gump.h
@@ -79,7 +79,7 @@ protected:
uint16 statbuttongid;
private:
- const Pentagram::Rect backpack_rect;
+ const Rect backpack_rect;
};
} // End of namespace Ultima8
diff --git a/engines/ultima/ultima8/gumps/pentagram_menu_gump.cpp b/engines/ultima/ultima8/gumps/pentagram_menu_gump.cpp
index 7b77cb7..aeceb13 100644
--- a/engines/ultima/ultima8/gumps/pentagram_menu_gump.cpp
+++ b/engines/ultima/ultima8/gumps/pentagram_menu_gump.cpp
@@ -63,12 +63,12 @@ void PentagramMenuGump::InitGump(Gump *newparent, bool take_focus) {
GameWidget *g;
int y_ = 50;
- Std::vector<Pentagram::istring> games;
+ Std::vector<istring> games;
// TODO: listGames() should probably be in CoreApp
games = SettingManager::get_instance()->listGames();
unsigned int gameIndex = 0;
for (unsigned int i = 0; i < games.size(); ++i) {
- Pentagram::istring gameName = games[i];
+ istring gameName = games[i];
if (gameName == "pentagram") continue;
if (!Ultima8Engine::get_instance()->getGameInfo(gameName)) continue;
@@ -124,8 +124,8 @@ void PentagramMenuGump::PaintChildren(RenderSurface *surf, int32 lerp_factor, bo
Std::list<Gump *>::iterator it = children.begin();
Std::list<Gump *>::iterator end = children.end();
- Pentagram::Rect game_clip_rect(0, 45, SCREEN_WIDTH, dims.h - 58);
- Pentagram::Rect cur_clip_rect;
+ Rect game_clip_rect(0, 45, SCREEN_WIDTH, dims.h - 58);
+ Rect cur_clip_rect;
surf->GetClippingRect(cur_clip_rect);
@@ -150,7 +150,7 @@ void PentagramMenuGump::ChildNotify(Gump *child, uint32 message) {
if (child->IsOfType<GameWidget>()) {
GameWidget *gw = p_dynamic_cast<GameWidget *>(child);
- Pentagram::istring gamename = gw->getGameName();
+ istring gamename = gw->getGameName();
switch (message) {
case GameWidget::GAME_PLAY:
diff --git a/engines/ultima/ultima8/gumps/readable_gump.cpp b/engines/ultima/ultima8/gumps/readable_gump.cpp
index 800575f..ad11117 100644
--- a/engines/ultima/ultima8/gumps/readable_gump.cpp
+++ b/engines/ultima/ultima8/gumps/readable_gump.cpp
@@ -80,13 +80,13 @@ void ReadableGump::InitGump(Gump *newparent, bool take_focus) {
Std::string jpsub = text.substr(pos + 1);
text = text.substr(0, pos);
- Gump *subwidget = new TextWidget(0, 0, jpsub, true, jpsub_font, 0, 0, Pentagram::Font::TEXT_CENTER);
+ Gump *subwidget = new TextWidget(0, 0, jpsub, true, jpsub_font, 0, 0, Font::TEXT_CENTER);
subwidget->InitGump(this);
subwidget->setRelativePosition(BOTTOM_CENTER, 0, -8);
}
}
- Gump *widget = new TextWidget(0, 0, text, true, fontnum, dims.w - 16, 0, Pentagram::Font::TEXT_CENTER);
+ Gump *widget = new TextWidget(0, 0, text, true, fontnum, dims.w - 16, 0, Font::TEXT_CENTER);
widget->InitGump(this);
widget->setRelativePosition(CENTER);
}
diff --git a/engines/ultima/ultima8/gumps/scaler_gump.cpp b/engines/ultima/ultima8/gumps/scaler_gump.cpp
index 80ccd0c..ae96893 100644
--- a/engines/ultima/ultima8/gumps/scaler_gump.cpp
+++ b/engines/ultima/ultima8/gumps/scaler_gump.cpp
@@ -95,7 +95,7 @@ void ScalerGump::Paint(RenderSurface *surf, int32 lerp_factor, bool scaled) {
}
}
-void ScalerGump::DoScalerBlit(Texture *src, int swidth, int sheight, RenderSurface *dest, int dwidth, int dheight, const Pentagram::Scaler *scaler) {
+void ScalerGump::DoScalerBlit(Texture *src, int swidth, int sheight, RenderSurface *dest, int dwidth, int dheight, const Scaler *scaler) {
bool ok = true;
// Cheap and nasty method to use a 2x scaler to do a 2.4x scale vertically
@@ -161,7 +161,7 @@ void ScalerGump::GumpToParent(int32 &gx, int32 &gy, PointRoundDir r) {
void ScalerGump::RenderSurfaceChanged() {
// Resize the gump to match the RenderSurface
- Pentagram::Rect new_dims;
+ Rect new_dims;
parent->GetDims(new_dims);
width = new_dims.w;
@@ -180,7 +180,7 @@ void ScalerGump::setupScaling() {
sheight1 = 200;
swidth2 = 0;
sheight2 = 0;
- const Pentagram::Scaler *point = &Ultima8Engine::get_instance()->point_scaler;
+ const Scaler *point = &Ultima8Engine::get_instance()->point_scaler;
scaler1 = scaler2 = point;
if (swidth1 < 0) swidth1 = -swidth1;
diff --git a/engines/ultima/ultima8/gumps/scaler_gump.h b/engines/ultima/ultima8/gumps/scaler_gump.h
index 97ab0a5..26a9a52 100644
--- a/engines/ultima/ultima8/gumps/scaler_gump.h
+++ b/engines/ultima/ultima8/gumps/scaler_gump.h
@@ -32,10 +32,7 @@ namespace Ultima8 {
class RenderSurface;
struct Texture;
-
-namespace Pentagram {
class Scaler;
-}
class ScalerGump : public DesktopGump {
public:
@@ -67,12 +64,12 @@ public:
protected:
int swidth1;
int sheight1;
- const Pentagram::Scaler *scaler1;
+ const Scaler *scaler1;
RenderSurface *buffer1;
int swidth2;
int sheight2;
- const Pentagram::Scaler *scaler2;
+ const Scaler *scaler2;
RenderSurface *buffer2;
int32 width;
@@ -81,7 +78,7 @@ protected:
private:
void setupScaling();
- void DoScalerBlit(Texture *src, int swidth, int sheight, RenderSurface *dest, int dwidth, int dheight, const Pentagram::Scaler *scaler);
+ void DoScalerBlit(Texture *src, int swidth, int sheight, RenderSurface *dest, int dwidth, int dheight, const Scaler *scaler);
};
} // End of namespace Ultima8
diff --git a/engines/ultima/ultima8/gumps/shape_viewer_gump.cpp b/engines/ultima/ultima8/gumps/shape_viewer_gump.cpp
index 4f5d596..67ee7be 100644
--- a/engines/ultima/ultima8/gumps/shape_viewer_gump.cpp
+++ b/engines/ultima/ultima8/gumps/shape_viewer_gump.cpp
@@ -88,7 +88,7 @@ void ShapeViewerGump::PaintThis(RenderSurface *surf, int32 lerp_factor, bool /*s
surf->Paint(shape_, curframe, posx, posy);
RenderedText *rendtext;
- Pentagram::Font *font = FontManager::get_instance()->getGameFont(0, true);
+ Font *font = FontManager::get_instance()->getGameFont(0, true);
unsigned int remaining;
char buf1[50];
@@ -267,7 +267,7 @@ void ShapeViewerGump::U8ShapeViewer() {
}
Gump *desktopGump = Ultima8Engine::get_instance()->getDesktopGump();
- Pentagram::Rect res;
+ Rect res;
desktopGump->GetDims(res);
ModalGump *gump = new ShapeViewerGump((res.w * 3) / 4, (res.h * 3) / 4, flexes);
diff --git a/engines/ultima/ultima8/gumps/slider_gump.cpp b/engines/ultima/ultima8/gumps/slider_gump.cpp
index 7777443..684c13a 100644
--- a/engines/ultima/ultima8/gumps/slider_gump.cpp
+++ b/engines/ultima/ultima8/gumps/slider_gump.cpp
@@ -105,7 +105,7 @@ void SliderGump::setSliderPos() {
void SliderGump::drawText(RenderSurface *surf) {
if (!renderedtext || value != renderedvalue) {
- Pentagram::Font *font;
+ Font *font;
font = FontManager::get_instance()->getGameFont(labelfont);
char buf[10]; // more than enough for a int16
sprintf(buf, "%d", value);
diff --git a/engines/ultima/ultima8/gumps/u8_save_gump.cpp b/engines/ultima/ultima8/gumps/u8_save_gump.cpp
index 16db762..00cd2c2 100644
--- a/engines/ultima/ultima8/gumps/u8_save_gump.cpp
+++ b/engines/ultima/ultima8/gumps/u8_save_gump.cpp
@@ -118,7 +118,7 @@ void U8SaveGump::InitGump(Gump *newparent, bool take_focus) {
if (index_ % 10 == 9) {
// HACK: There is no frame for '0', so we re-use part of the
// frame for '10', cutting off the first 6 pixels.
- Pentagram::Rect rect;
+ Rect rect;
gump->GetDims(rect);
rect.x += 6;
gump->SetDims(rect);
diff --git a/engines/ultima/ultima8/gumps/widgets/edit_widget.cpp b/engines/ultima/ultima8/gumps/widgets/edit_widget.cpp
index 1cc63c4..665ae18 100644
--- a/engines/ultima/ultima8/gumps/widgets/edit_widget.cpp
+++ b/engines/ultima/ultima8/gumps/widgets/edit_widget.cpp
@@ -55,7 +55,7 @@ EditWidget::~EditWidget(void) {
void EditWidget::InitGump(Gump *newparent, bool take_focus) {
Gump::InitGump(newparent, take_focus);
- Pentagram::Font *font = getFont();
+ Font *font = getFont();
// Y offset is always baseline
dims.y = -font->getBaseline();
@@ -69,7 +69,7 @@ void EditWidget::InitGump(Gump *newparent, bool take_focus) {
}
}
-Pentagram::Font *EditWidget::getFont() const {
+Font *EditWidget::getFont() const {
if (gamefont)
return FontManager::get_instance()->getGameFont(fontnum, true);
else
@@ -88,7 +88,7 @@ void EditWidget::ensureCursorVisible() {
}
bool EditWidget::textFits(Std::string &t) {
- Pentagram::Font *font = getFont();
+ Font *font = getFont();
unsigned int remaining;
int32 width, height;
@@ -102,7 +102,7 @@ bool EditWidget::textFits(Std::string &t) {
font->getTextSize(t, width, height, remaining,
max_width, max_height,
- Pentagram::Font::TEXT_LEFT, false);
+ Font::TEXT_LEFT, false);
if (gamefont && font->isHighRes()) {
int32 x_ = 0, y_ = 0;
@@ -133,7 +133,7 @@ void EditWidget::renderText() {
}
if (!cached_text) {
- Pentagram::Font *font = getFont();
+ Font *font = getFont();
int32 max_width = multiline ? dims.w : 0;
int32 max_height = dims.h;
@@ -145,7 +145,7 @@ void EditWidget::renderText() {
unsigned int remaining;
cached_text = font->renderText(text, remaining,
max_width, max_height,
- Pentagram::Font::TEXT_LEFT,
+ Font::TEXT_LEFT,
false, cv ? cursor : Std::string::npos);
}
}
@@ -166,7 +166,7 @@ void EditWidget::PaintThis(RenderSurface *surf, int32 lerp_factor, bool scaled)
// Overloadable method to Paint just this gumps unscaled components that require compositing (RenderSurface is relative to parent).
void EditWidget::PaintComposited(RenderSurface *surf, int32 lerp_factor, int32 sx, int32 sy) {
- Pentagram::Font *font = getFont();
+ Font *font = getFont();
if (!gamefont || !font->isHighRes()) return;
@@ -241,7 +241,7 @@ bool EditWidget::OnTextInput(int unicode) {
char c = 0;
if (unicode >= 0 && unicode < 256)
- c = Pentagram::reverse_encoding[unicode];
+ c = reverse_encoding[unicode];
if (!c) return true;
Std::string newtext = text;
diff --git a/engines/ultima/ultima8/gumps/widgets/edit_widget.h b/engines/ultima/ultima8/gumps/widgets/edit_widget.h
index 4b8f62f..92c11e0 100644
--- a/engines/ultima/ultima8/gumps/widgets/edit_widget.h
+++ b/engines/ultima/ultima8/gumps/widgets/edit_widget.h
@@ -35,8 +35,6 @@
namespace Ultima {
namespace Ultima8 {
-using Pentagram::Font;
-
class RenderedText;
class EditWidget : public Gump {
@@ -84,7 +82,7 @@ protected:
void ensureCursorVisible();
bool textFits(Std::string &t);
void renderText();
- Pentagram::Font *getFont() const;
+ Font *getFont() const;
RenderedText *cached_text;
diff --git a/engines/ultima/ultima8/gumps/widgets/game_widget.cpp b/engines/ultima/ultima8/gumps/widgets/game_widget.cpp
index 85d17b8..75937e7 100644
--- a/engines/ultima/ultima8/gumps/widgets/game_widget.cpp
+++ b/engines/ultima/ultima8/gumps/widgets/game_widget.cpp
@@ -36,7 +36,7 @@ namespace Ultima8 {
DEFINE_RUNTIME_CLASSTYPE_CODE(GameWidget, Gump)
-GameWidget::GameWidget(int X, int Y, Pentagram::istring &game)
+GameWidget::GameWidget(int X, int Y, istring &game)
: Gump(X, Y, 443, 109), highlight(false) {
info = Ultima8Engine::get_instance()->getGameInfo(game);
assert(info);
@@ -46,7 +46,7 @@ GameWidget::~GameWidget() {
}
-Pentagram::istring GameWidget::getGameName() {
+istring GameWidget::getGameName() {
return info->name;
}
void GameWidget::InitGump(Gump *newparent, bool take_focus) {
@@ -156,7 +156,7 @@ void GameWidget::PaintThis(RenderSurface *surf, int32 lerp_factor, bool /*scaled
#if 0
- Pentagram::Font *font = FontManager::get_instance()->getTTFont(1);
+ Font *font = FontManager::get_instance()->getTTFont(1);
assert(font);
// FIXME: convert these into ButtonWidgets, localize texts,
diff --git a/engines/ultima/ultima8/gumps/widgets/game_widget.h b/engines/ultima/ultima8/gumps/widgets/game_widget.h
index ef878c8..47566c9 100644
--- a/engines/ultima/ultima8/gumps/widgets/game_widget.h
+++ b/engines/ultima/ultima8/gumps/widgets/game_widget.h
@@ -36,10 +36,10 @@ public:
// p_dynamic_class stuff
ENABLE_RUNTIME_CLASSTYPE()
- GameWidget(int X, int Y, Pentagram::istring &game);
+ GameWidget(int X, int Y, istring &game);
virtual ~GameWidget();
- Pentagram::istring getGameName();
+ istring getGameName();
virtual void InitGump(Gump *newparent, bool take_focus = true) override;
diff --git a/engines/ultima/ultima8/gumps/widgets/text_widget.cpp b/engines/ultima/ultima8/gumps/widgets/text_widget.cpp
index b8abae4..4a265af 100644
--- a/engines/ultima/ultima8/gumps/widgets/text_widget.cpp
+++ b/engines/ultima/ultima8/gumps/widgets/text_widget.cpp
@@ -60,7 +60,7 @@ TextWidget::~TextWidget(void) {
void TextWidget::InitGump(Gump *newparent, bool take_focus) {
Gump::InitGump(newparent, take_focus);
- Pentagram::Font *font = getFont();
+ Font *font = getFont();
// Y offset is always baseline
dims.y = -font->getBaseline();
@@ -104,7 +104,7 @@ int TextWidget::getVlead() {
return vlead;
}
-Pentagram::Font *TextWidget::getFont() const {
+Font *TextWidget::getFont() const {
if (gamefont)
return FontManager::get_instance()->getGameFont(fontnum, true);
else
@@ -116,7 +116,7 @@ bool TextWidget::setupNextText() {
if (current_start >= text.size()) return false;
- Pentagram::Font *font = getFont();
+ Font *font = getFont();
unsigned int remaining;
font->getTextSize(text.substr(current_start), tx, ty, remaining,
@@ -133,7 +133,7 @@ bool TextWidget::setupNextText() {
cached_text = 0;
if (gamefont) {
- Pentagram::Font *fontP = getFont();
+ Font *fontP = getFont();
if (fontP->isHighRes()) {
int32 x_ = 0, y_ = 0;
ScreenSpaceToGumpRect(x_, y_, dims.w, dims.h, ROUND_OUTSIDE);
@@ -156,7 +156,7 @@ void TextWidget::rewind() {
void TextWidget::renderText() {
if (!cached_text) {
- Pentagram::Font *font = getFont();
+ Font *font = getFont();
unsigned int remaining;
cached_text = font->renderText(text.substr(current_start,
@@ -185,7 +185,7 @@ void TextWidget::PaintThis(RenderSurface *surf, int32 lerp_factor, bool scaled)
// Overloadable method to Paint just this gumps unscaled components that require compositing (RenderSurface is relative to parent).
void TextWidget::PaintComposited(RenderSurface *surf, int32 lerp_factor, int32 sx, int32 sy) {
- Pentagram::Font *font = getFont();
+ Font *font = getFont();
if (!gamefont || !font->isHighRes()) return;
@@ -254,7 +254,7 @@ bool TextWidget::loadData(IDataSource *ids, uint32 version) {
// HACK ALERT: this is to deal with possibly changing font sizes
// after loading.
- Pentagram::Font *font = getFont();
+ Font *font = getFont();
int32 tx_, ty_;
unsigned int remaining;
diff --git a/engines/ultima/ultima8/gumps/widgets/text_widget.h b/engines/ultima/ultima8/gumps/widgets/text_widget.h
index 14c5ab9..ecbe4ba 100644
--- a/engines/ultima/ultima8/gumps/widgets/text_widget.h
+++ b/engines/ultima/ultima8/gumps/widgets/text_widget.h
@@ -34,8 +34,6 @@
namespace Ultima {
namespace Ultima8 {
-using Pentagram::Font;
-
class RenderedText;
class TextWidget : public Gump {
@@ -98,7 +96,7 @@ public:
protected:
void renderText();
- Pentagram::Font *getFont() const;
+ Font *getFont() const;
public:
bool loadData(IDataSource *ids, uint32 version);
diff --git a/engines/ultima/ultima8/kernel/core_app.cpp b/engines/ultima/ultima8/kernel/core_app.cpp
index e58bdb4..0f00893 100644
--- a/engines/ultima/ultima8/kernel/core_app.cpp
+++ b/engines/ultima/ultima8/kernel/core_app.cpp
@@ -144,14 +144,14 @@ void CoreApp::loadConfig() {
}
void CoreApp::setupGameList() {
- Std::vector<Pentagram::istring> gamelist;
+ Std::vector<istring> gamelist;
gamelist = settingman->listGames();
con->Print(MM_INFO, "Scanning config file for games:\n");
- Std::vector<Pentagram::istring>::iterator iter;
- Pentagram::istring gamename;
+ Std::vector<istring>::iterator iter;
+ istring gamename;
for (iter = gamelist.begin(); iter != gamelist.end(); ++iter) {
- Pentagram::istring game = *iter;
+ istring game = *iter;
GameInfo *info = new GameInfo;
bool detected = getGameInfo(game, info);
@@ -171,7 +171,7 @@ void CoreApp::setupGameList() {
}
GameInfo *CoreApp::getDefaultGame() {
- Pentagram::istring gamename;
+ istring gamename;
Std::string defaultgame;
bool defaultset = settingman->get("defaultgame", defaultgame,
@@ -252,7 +252,7 @@ void CoreApp::killGame() {
}
-bool CoreApp::getGameInfo(Pentagram::istring &game, GameInfo *ginfo) {
+bool CoreApp::getGameInfo(istring &game, GameInfo *ginfo) {
// first try getting the information from the config file
// if that fails, try to autodetect it
@@ -261,7 +261,7 @@ bool CoreApp::getGameInfo(Pentagram::istring &game, GameInfo *ginfo) {
ginfo->version = 0;
ginfo->language = GameInfo::GAMELANG_UNKNOWN;
- Pentagram::istring gamekey = "settings/";
+ istring gamekey = "settings/";
gamekey += game;
if (game == "pentagram") {
@@ -304,7 +304,7 @@ void CoreApp::setupGamePaths(GameInfo *ginfo) {
return;
}
- Pentagram::istring game = ginfo->name;
+ istring game = ginfo->name;
settingman->setDomainName(SettingManager::DOM_GAME, game);
settingman->setCurrentDomain(SettingManager::DOM_GAME);
@@ -357,7 +357,7 @@ void CoreApp::helpMe() {
con->Print("\t--game {name}\t- select a game\n");
}
-GameInfo *CoreApp::getGameInfo(Pentagram::istring game) const {
+GameInfo *CoreApp::getGameInfo(istring game) const {
GameMap::const_iterator i;
i = games.find(game);
diff --git a/engines/ultima/ultima8/kernel/core_app.h b/engines/ultima/ultima8/kernel/core_app.h
index cda6c26..af6e01b 100644
--- a/engines/ultima/ultima8/kernel/core_app.h
+++ b/engines/ultima/ultima8/kernel/core_app.h
@@ -75,7 +75,7 @@ public:
}
//! Get GameInfo for other configured game, or 0 for an invalid name.
- GameInfo *getGameInfo(Pentagram::istring game) const;
+ GameInfo *getGameInfo(istring game) const;
virtual void helpMe();
@@ -124,7 +124,7 @@ private:
//! \param game The id of the game to check (from pentagram.cfg)
//! \param gameinfo The GameInfo struct to fill
//! \return true if detected all the fields, false if detection failed
- bool getGameInfo(Pentagram::istring &game, GameInfo *gameinfo);
+ bool getGameInfo(istring &game, GameInfo *gameinfo);
//! load configuration files
void loadConfig();
diff --git a/engines/ultima/ultima8/kernel/hid_keys.cpp b/engines/ultima/ultima8/kernel/hid_keys.cpp
index 9979a83..e4bd549 100644
--- a/engines/ultima/ultima8/kernel/hid_keys.cpp
+++ b/engines/ultima/ultima8/kernel/hid_keys.cpp
@@ -301,7 +301,7 @@ const char *HID_GetKeyName(HID_Key key) {
return "";
}
-HID_Key HID_GetKeyFromName(Pentagram::istring &name) {
+HID_Key HID_GetKeyFromName(istring &name) {
int i;
for (i = 0; keyNames[i].key != HID_LAST; ++i) {
if (name == keyNames[i].name)
@@ -669,15 +669,15 @@ const char *HID_GetEventsName(HID_Events events) {
return buffer;
}
-HID_Events HID_GetEventFromName(const Pentagram::istring &name) {
+HID_Events HID_GetEventFromName(const istring &name) {
// Split up the name(s)
- Pentagram::istring str = name;
+ istring str = name;
if (name.hasPrefix("<") && name.hasSuffix(">")) {
str.deleteChar(0);
str.deleteLastChar();
}
- Common::Array<Pentagram::istring> events;
+ Common::Array<istring> events;
str.split(events);
HID_Events result = 0;
diff --git a/engines/ultima/ultima8/kernel/hid_keys.h b/engines/ultima/ultima8/kernel/hid_keys.h
index ffdf90c..22e9b9d 100644
--- a/engines/ultima/ultima8/kernel/hid_keys.h
+++ b/engines/ultima/ultima8/kernel/hid_keys.h
@@ -206,7 +206,7 @@ enum HID_Key {
};
const char *HID_GetKeyName(HID_Key key);
-HID_Key HID_GetKeyFromName(Pentagram::istring &name);
+HID_Key HID_GetKeyFromName(istring &name);
HID_Key HID_translateSDLKey(Common::KeyCode key);
HID_Key HID_translateSDLMouseButton(uint8 button);
@@ -229,7 +229,7 @@ typedef uint16 HID_Events;
HID_Events HID_translateSDLKeyFlags(byte flags);
const char *HID_GetEventsName(HID_Events event);
-HID_Events HID_GetEventFromName(const Pentagram::istring &name);
+HID_Events HID_GetEventFromName(const istring &name);
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/kernel/hid_manager.cpp b/engines/ultima/ultima8/kernel/hid_manager.cpp
index 3d2314f..0514449 100644
--- a/engines/ultima/ultima8/kernel/hid_manager.cpp
+++ b/engines/ultima/ultima8/kernel/hid_manager.cpp
@@ -115,8 +115,8 @@ void HIDManager::loadBindings() {
void HIDManager::saveBindings() {
uint16 key, events;
SettingManager *settings = SettingManager::get_instance();
- Pentagram::istring section = "keys/";
- Pentagram::istring confkey;
+ istring section = "keys/";
+ istring confkey;
for (Bindings::iterator it = _bindings.begin(); it != _bindings.end(); ++it) {
key = it->_key & 0xffff;
@@ -126,18 +126,18 @@ void HIDManager::saveBindings() {
HID_GetKeyName((HID_Key) key);
Console::ArgsType command;
- Pentagram::ArgvToString(*(it->_value), command);
+ ArgvToString(*(it->_value), command);
settings->set(confkey, command);
// settings->unset(confkey);
}
}
-void HIDManager::bind(const Pentagram::istring &control, const Console::ArgvType &argv) {
+void HIDManager::bind(const istring &control, const Console::ArgvType &argv) {
HID_Key key = HID_LAST;
HID_Events event = HID_EVENT_DEPRESS;
- Std::vector<Pentagram::istring> ctrl_argv;
+ Std::vector<istring> ctrl_argv;
- Pentagram::StringToArgv(control, ctrl_argv);
+ StringToArgv(control, ctrl_argv);
if (ctrl_argv.size() == 1) {
key = HID_GetKeyFromName(ctrl_argv[0]);
} else if (ctrl_argv.size() > 1) {
@@ -149,9 +149,9 @@ void HIDManager::bind(const Pentagram::istring &control, const Console::ArgvType
bind(key, event, argv);
}
-void HIDManager::bind(const Pentagram::istring &control, const Console::ArgsType &args) {
+void HIDManager::bind(const istring &control, const Console::ArgsType &args) {
Console::ArgvType argv;
- Pentagram::StringToArgv(args, argv);
+ StringToArgv(args, argv);
bind(control, argv);
}
@@ -181,11 +181,11 @@ void HIDManager::bind(HID_Key key, HID_Events event, const Console::ArgvType &ar
void HIDManager::bind(HID_Key key, HID_Events event, const Console::ArgsType &args) {
Console::ArgvType argv;
- Pentagram::StringToArgv(args, argv);
+ StringToArgv(args, argv);
bind(key, event, argv);
}
-void HIDManager::unbind(const Pentagram::istring &control) {
+void HIDManager::unbind(const istring &control) {
// bind to an empty control
Console::ArgvType command;
bind(control, command);
@@ -201,7 +201,7 @@ void HIDManager::ConCmd_bind(const Console::ArgvType &argv) {
}
HIDManager *hid = HIDManager::get_instance();
- Pentagram::istring control(argv[1]);
+ istring control(argv[1]);
it = argv.begin();
++it;
@@ -219,7 +219,7 @@ void HIDManager::ConCmd_unbind(const Console::ArgvType &argv) {
}
HIDManager *hid = HIDManager::get_instance();
- Pentagram::istring control(argv[1]);
+ istring control(argv[1]);
hid->unbind(control);
}
@@ -244,7 +244,7 @@ void HIDManager::listBindings() {
for (Bindings::iterator it = _bindings.begin(); it != _bindings.end(); ++it) {
key = it->_key & 0xffff;
event = it->_key >> 16;
- Pentagram::ArgvToString(*(it->_value), command);
+ ArgvToString(*(it->_value), command);
if (event == HID_EVENT_DEPRESS) {
pout << HID_GetKeyName((HID_Key)key) << " = " << command << Std::endl;
diff --git a/engines/ultima/ultima8/kernel/hid_manager.h b/engines/ultima/ultima8/kernel/hid_manager.h
index e47c3d5..112e7b7 100644
--- a/engines/ultima/ultima8/kernel/hid_manager.h
+++ b/engines/ultima/ultima8/kernel/hid_manager.h
@@ -66,15 +66,15 @@ public:
//! loads a single keybinding
//! \param control a key or button to bind
//! \param bindingName name of the HIDBinding
- void bind(const Pentagram::istring &control, const Console::ArgvType &argv);
+ void bind(const istring &control, const Console::ArgvType &argv);
- void bind(const Pentagram::istring &control, const Console::ArgsType &args);
+ void bind(const istring &control, const Console::ArgsType &args);
void bind(HID_Key key, HID_Events event, const Console::ArgvType &argv);
void bind(HID_Key key, HID_Events event, const Console::ArgsType &args);
//! removes all controls to a HIDBinding or the binding to one specified key
//! \param bindingName name of a HIDBinding or the name of key
- void unbind(const Pentagram::istring &control);
+ void unbind(const istring &control);
//! "bind" console command
static void ConCmd_bind(const Console::ArgvType &argv);
diff --git a/engines/ultima/ultima8/kernel/memory_manager.cpp b/engines/ultima/ultima8/kernel/memory_manager.cpp
index 813d609..4a89a72 100644
--- a/engines/ultima/ultima8/kernel/memory_manager.cpp
+++ b/engines/ultima/ultima8/kernel/memory_manager.cpp
@@ -38,14 +38,14 @@ MemoryManager::MemoryManager() {
allocators[0] = new SegmentedAllocator(192, 8500);
allocators[1] = new SegmentedAllocator(4224, 25);
- Pentagram::setAllocationFunctions(MemoryManager::allocate,
+ setAllocationFunctions(MemoryManager::allocate,
MemoryManager::deallocate);
}
MemoryManager::~MemoryManager() {
memorymanager = 0;
- Pentagram::setAllocationFunctions(malloc, free);
+ setAllocationFunctions(malloc, free);
delete allocators[0];
delete allocators[1];
}
diff --git a/engines/ultima/ultima8/kernel/mouse.cpp b/engines/ultima/ultima8/kernel/mouse.cpp
index cbcc221..a7bba4a 100644
--- a/engines/ultima/ultima8/kernel/mouse.cpp
+++ b/engines/ultima/ultima8/kernel/mouse.cpp
@@ -141,7 +141,7 @@ bool Mouse::isMouseDownEvent(Shared::MouseButton button) {
}
int Mouse::getMouseLength(int mx, int my) {
- Pentagram::Rect dims;
+ Rect dims;
RenderSurface *screen = Ultima8Engine::get_instance()->getRenderScreen();
screen->GetSurfaceDims(dims);
@@ -172,7 +172,7 @@ int Mouse::getMouseLength(int mx, int my) {
}
int Mouse::getMouseDirection(int mx, int my) {
- Pentagram::Rect dims;
+ Rect dims;
RenderSurface *screen = Ultima8Engine::get_instance()->getRenderScreen();
screen->GetSurfaceDims(dims);
@@ -254,7 +254,7 @@ int Mouse::getMouseFrame() {
}
void Mouse::setMouseCoords(int mx, int my) {
- Pentagram::Rect dims;
+ Rect dims;
RenderSurface *screen = Ultima8Engine::get_instance()->getRenderScreen();
screen->GetSurfaceDims(dims);
diff --git a/engines/ultima/ultima8/misc/box.h b/engines/ultima/ultima8/misc/box.h
index 6a91590..ba97dc7 100644
--- a/engines/ultima/ultima8/misc/box.h
+++ b/engines/ultima/ultima8/misc/box.h
@@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
struct Box {
int32 x, y, z;
@@ -99,7 +98,6 @@ struct Box {
};
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/misc/console.cpp b/engines/ultima/ultima8/misc/console.cpp
index 05198f9..3336e16 100644
--- a/engines/ultima/ultima8/misc/console.cpp
+++ b/engines/ultima/ultima8/misc/console.cpp
@@ -544,7 +544,7 @@ void Console::RemoveConsoleCommand(Console::Function function) {
}
void Console::ExecuteConsoleCommand(const Console::ArgsType &args) {
Console::ArgvType argv;
- Pentagram::StringToArgv(args, argv);
+ StringToArgv(args, argv);
ExecuteConsoleCommand(argv);
}
@@ -670,7 +670,7 @@ void Console::AddCharacterToCommandBuffer(int ch) {
args += '\"';
ArgvType argv;
- Pentagram::StringToArgv(args, argv);
+ StringToArgv(args, argv);
ConCmd_CmdList(argv);
commandBuffer = common;
diff --git a/engines/ultima/ultima8/misc/console.h b/engines/ultima/ultima8/misc/console.h
index 58dbcc8..471e014 100644
--- a/engines/ultima/ultima8/misc/console.h
+++ b/engines/ultima/ultima8/misc/console.h
@@ -250,7 +250,7 @@ public:
// Console Commands
//
- typedef Pentagram::istring ArgsType;
+ typedef istring ArgsType;
typedef Std::vector<ArgsType> ArgvType;
typedef void (*Function)(const ArgvType &argv);
diff --git a/engines/ultima/ultima8/misc/encoding.cpp b/engines/ultima/ultima8/misc/encoding.cpp
index 6242a82..17eed7b 100644
--- a/engines/ultima/ultima8/misc/encoding.cpp
+++ b/engines/ultima/ultima8/misc/encoding.cpp
@@ -29,7 +29,6 @@ Copyright (C) 1999-2004 Free Software Foundation, Inc.
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
// U8's encoding to unicode
@@ -1442,6 +1441,5 @@ uint32 shiftjis_to_unicode(uint16 sjis) {
return val;
}
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/misc/encoding.h b/engines/ultima/ultima8/misc/encoding.h
index 28aaf73..7091549 100644
--- a/engines/ultima/ultima8/misc/encoding.h
+++ b/engines/ultima/ultima8/misc/encoding.h
@@ -25,7 +25,6 @@
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
extern uint8 reverse_encoding[256];
extern uint16 encoding[256];
@@ -37,7 +36,6 @@ extern uint16 encoding[256];
uint16 shiftjis_to_ultima8(uint16 sjis);
uint32 shiftjis_to_unicode(uint16 sjis);
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/misc/istring.cpp b/engines/ultima/ultima8/misc/istring.cpp
index bc53bb7..fc72606 100644
--- a/engines/ultima/ultima8/misc/istring.cpp
+++ b/engines/ultima/ultima8/misc/istring.cpp
@@ -26,7 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
int strncasecmp(const char *s1, const char *s2, uint32 length) {
uint32 c1, c2;
@@ -73,7 +72,7 @@ void istring::split(Common::Array<istring> &arr) const {
for (;;) {
endP = strchr(startP + 1, ',');
- arr.push_back(Pentagram::istring(startP, endP ? endP : _str + _size));
+ arr.push_back(istring(startP, endP ? endP : _str + _size));
if (!endP)
break;
@@ -81,7 +80,5 @@ void istring::split(Common::Array<istring> &arr) const {
}
}
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
-
diff --git a/engines/ultima/ultima8/misc/istring.h b/engines/ultima/ultima8/misc/istring.h
index 935f9c7..f0b67c7 100644
--- a/engines/ultima/ultima8/misc/istring.h
+++ b/engines/ultima/ultima8/misc/istring.h
@@ -37,7 +37,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
extern int strcasecmp(const char *s1, const char *s2);
extern int strncasecmp(const char *s1, const char *s2, uint32 length);
@@ -80,7 +79,6 @@ public:
void split(Common::Array<istring> &arr) const ;
};
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/misc/md5.cpp b/engines/ultima/ultima8/misc/md5.cpp
index 22de87f..b4ff59c 100644
--- a/engines/ultima/ultima8/misc/md5.cpp
+++ b/engines/ultima/ultima8/misc/md5.cpp
@@ -28,7 +28,6 @@
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
struct md5_context {
uint32 total[2];
@@ -268,6 +267,5 @@ bool md5_file(IDataSource *input, uint8 digest[16], uint32 length) {
return true;
}
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/misc/md5.h b/engines/ultima/ultima8/misc/md5.h
index 9d9a276..d608f1b 100644
--- a/engines/ultima/ultima8/misc/md5.h
+++ b/engines/ultima/ultima8/misc/md5.h
@@ -24,11 +24,8 @@ namespace Ultima8 {
class IDataSource;
-namespace Pentagram {
-
bool md5_file(IDataSource *input, uint8 digest[16], uint32 length = 0);
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/misc/memset_n.h b/engines/ultima/ultima8/misc/memset_n.h
index a1c91ee..af9aeae 100644
--- a/engines/ultima/ultima8/misc/memset_n.h
+++ b/engines/ultima/ultima8/misc/memset_n.h
@@ -26,7 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
//
// Generic memset_32
@@ -101,7 +100,6 @@ inline void memset_16(void *buf, int32 val, uint32 words) {
if (words & 1) *(reinterpret_cast<uint16 *>(buf)) = static_cast<uint16>(val & 0xFFFF);
}
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/misc/pent_include.cpp b/engines/ultima/ultima8/misc/pent_include.cpp
index 35b6683..4c57b09 100644
--- a/engines/ultima/ultima8/misc/pent_include.cpp
+++ b/engines/ultima/ultima8/misc/pent_include.cpp
@@ -24,7 +24,6 @@
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
allocFunc palloc = malloc;
deallocFunc pfree = free;
@@ -34,6 +33,5 @@ void setAllocationFunctions(allocFunc a, deallocFunc d) {
pfree = d;
}
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/misc/pent_include.h b/engines/ultima/ultima8/misc/pent_include.h
index d6c6af7..5c5513c 100644
--- a/engines/ultima/ultima8/misc/pent_include.h
+++ b/engines/ultima/ultima8/misc/pent_include.h
@@ -107,11 +107,9 @@ namespace Ultima8 {
typedef void *(*allocFunc)(size_t size);
typedef void (*deallocFunc)(void *ptr);
-namespace Pentagram {
extern allocFunc palloc;
extern deallocFunc pfree;
void setAllocationFunctions(allocFunc a, deallocFunc d);
-} // End of namespace Pentagram
#define ENABLE_CUSTOM_MEMORY_ALLOCATION() \
static void * operator new(size_t size); \
@@ -119,11 +117,11 @@ void setAllocationFunctions(allocFunc a, deallocFunc d);
#define DEFINE_CUSTOM_MEMORY_ALLOCATION(Classname) \
void * Classname::operator new(size_t size) { \
- return Pentagram::palloc(size); \
+ return palloc(size); \
} \
\
void Classname::operator delete(void * ptr) { \
- Pentagram::pfree(ptr); \
+ pfree(ptr); \
}
//
diff --git a/engines/ultima/ultima8/misc/rect.h b/engines/ultima/ultima8/misc/rect.h
index 195b3fc..f3ce6c8 100644
--- a/engines/ultima/ultima8/misc/rect.h
+++ b/engines/ultima/ultima8/misc/rect.h
@@ -21,7 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
struct Rect {
int32 x, y;
@@ -168,7 +167,6 @@ struct Rect {
};
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/misc/util.cpp b/engines/ultima/ultima8/misc/util.cpp
index 83adacf..41397aa 100644
--- a/engines/ultima/ultima8/misc/util.cpp
+++ b/engines/ultima/ultima8/misc/util.cpp
@@ -27,7 +27,6 @@
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
template<class T> T to_uppercase(const T s) {
T str = s;
@@ -97,7 +96,7 @@ template<class T> void StringToArgv(const T &args, Std::vector<T> &argv) {
}
template void StringToArgv<Std::string>(const Std::string &args, Std::vector<Std::string> &argv);
-template void StringToArgv<Pentagram::istring>(const Pentagram::istring &args, Std::vector<Pentagram::istring> &argv);
+template void StringToArgv<istring>(const istring &args, Std::vector<istring> &argv);
template<class T> void ArgvToString(const Std::vector<T> &argv, T &args) {
// Clear the string
@@ -134,7 +133,7 @@ template<class T> void ArgvToString(const Std::vector<T> &argv, T &args) {
}
template void ArgvToString<Std::string>(const Std::vector<Std::string> &argv, Std::string &args);
-template void ArgvToString<Pentagram::istring>(const Std::vector<Pentagram::istring> &argv, Pentagram::istring &args);
+template void ArgvToString<istring>(const Std::vector<istring> &argv, istring &args);
template<class T> void TrimSpaces(T &str) {
if (str.empty()) return;
@@ -150,7 +149,7 @@ template<class T> void TrimSpaces(T &str) {
}
template void TrimSpaces<Std::string>(Std::string &str);
-template void TrimSpaces<Pentagram::istring>(Pentagram::istring &str);
+template void TrimSpaces<istring>(istring &str);
template<class T> void TabsToSpaces(T &str, unsigned int n) {
@@ -161,7 +160,7 @@ template<class T> void TabsToSpaces(T &str, unsigned int n) {
}
template void TabsToSpaces<Std::string>(Std::string &str, unsigned int n);
-template void TabsToSpaces<Pentagram::istring>(Pentagram::istring &str, unsigned int n);
+template void TabsToSpaces<istring>(istring &str, unsigned int n);
template<class T> void SplitString(const T &args, char sep,
@@ -187,7 +186,7 @@ template<class T> void SplitString(const T &args, char sep,
template void SplitString<Std::string>(const Std::string &args, char sep, Std::vector<Std::string> &argv);
-template void SplitString<Pentagram::istring>(const Pentagram::istring &args, char sep, Std::vector<Pentagram::istring> &argv);
+template void SplitString<istring>(const istring &args, char sep, Std::vector<istring> &argv);
@@ -220,8 +219,7 @@ template<class T> void SplitStringKV(const T &args, char sep,
}
template void SplitStringKV<Std::string>(const Std::string &args, char sep, Std::vector<Std::pair<Std::string, Std::string> > &argv);
-template void SplitStringKV<Pentagram::istring>(const Pentagram::istring &args, char sep, Std::vector<Std::pair<Pentagram::istring, Pentagram::istring> > &argv);
+template void SplitStringKV<istring>(const istring &args, char sep, Std::vector<Std::pair<istring, istring> > &argv);
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/misc/util.h b/engines/ultima/ultima8/misc/util.h
index ce6f82f..95ac302 100644
--- a/engines/ultima/ultima8/misc/util.h
+++ b/engines/ultima/ultima8/misc/util.h
@@ -25,7 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
namespace Ultima {
namespace Ultima8 {
-namespace Pentagram {
template<class T> T to_uppercase(const T s);
@@ -42,7 +41,6 @@ template<class T> void SplitString(const T &args, char sep, Std::vector<T> &argv
template<class T> void SplitStringKV(const T &args, char sep,
Std::vector<Std::pair<T, T> > &argv);
-} // End of namespace Pentagram
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/ultima8.cpp b/engines/ultima/ultima8/ultima8.cpp
index 6f5fb73..3520f12 100644
--- a/engines/ultima/ultima8/ultima8.cpp
+++ b/engines/ultima/ultima8/ultima8.cpp
@@ -423,7 +423,7 @@ void Ultima8Engine::startup() {
hidmanager = new HIDManager();
// Audio Mixer
- audiomixer = new Pentagram::AudioMixer(_mixer);
+ audiomixer = new AudioMixer(_mixer);
pout << "-- Pentagram Initialized -- " << Std::endl << Std::endl;
@@ -575,7 +575,7 @@ void Ultima8Engine::startupPentagramMenu() {
con->SetAutoPaint(0);
consoleGump->HideConsole();
- Pentagram::Rect dims;
+ Rect dims;
desktopGump->GetDims(dims);
Gump *menugump = new PentagramMenuGump(0, 0, dims.w, dims.h);
@@ -658,7 +658,7 @@ void Ultima8Engine::shutdownGame(bool reloading) {
pout << "-- Game Shutdown -- " << Std::endl;
if (reloading) {
- Pentagram::Rect dims;
+ Rect dims;
screen->GetSurfaceDims(dims);
con->Print(MM_INFO, "Creating Desktop...\n");
@@ -670,7 +670,7 @@ void Ultima8Engine::shutdownGame(bool reloading) {
scalerGump = new ScalerGump(0, 0, dims.w, dims.h);
scalerGump->InitGump(0);
- Pentagram::Rect scaled_dims;
+ Rect scaled_dims;
scalerGump->GetDims(scaled_dims);
con->Print(MM_INFO, "Creating Graphics Console...\n");
@@ -686,11 +686,11 @@ void Ultima8Engine::shutdownGame(bool reloading) {
}
}
-void Ultima8Engine::changeGame(Pentagram::istring newgame) {
+void Ultima8Engine::changeGame(istring newgame) {
change_gamename = newgame;
}
-void Ultima8Engine::menuInitMinimal(Pentagram::istring gamename) {
+void Ultima8Engine::menuInitMinimal(istring gamename) {
// Only if in the pentagram menu
if (gameinfo->name != "pentagram") return;
GameInfo *info = getGameInfo(gamename);
@@ -839,7 +839,7 @@ void Ultima8Engine::paint() {
screen->BeginPainting();
// We need to get the dims
- Pentagram::Rect dims;
+ Rect dims;
screen->GetSurfaceDims(dims);
tpaint -= g_system->getMillis();
@@ -913,7 +913,7 @@ void Ultima8Engine::GraphicSysInit() {
#endif
if (screen) {
- Pentagram::Rect old_dims;
+ Rect old_dims;
screen->GetSurfaceDims(old_dims);
if (new_fullscreen == fullscreen && width == old_dims.w && height == old_dims.h) return;
bpp = RenderSurface::format.s_bpp;
@@ -975,7 +975,7 @@ void Ultima8Engine::GraphicSysInit() {
consoleGump = new ConsoleGump(0, 0, width, height);
consoleGump->InitGump(0);
- Pentagram::Rect scaled_dims;
+ Rect scaled_dims;
scalerGump->GetDims(scaled_dims);
inverterGump = new InverterGump(0, 0, scaled_dims.w, scaled_dims.h);
@@ -1454,7 +1454,7 @@ void Ultima8Engine::resetEngine() {
void Ultima8Engine::setupCoreGumps() {
con->Print(MM_INFO, "Setting up core game gumps...\n");
- Pentagram::Rect dims;
+ Rect dims;
screen->GetSurfaceDims(dims);
con->Print(MM_INFO, "Creating Desktop...\n");
@@ -1466,7 +1466,7 @@ void Ultima8Engine::setupCoreGumps() {
scalerGump = new ScalerGump(0, 0, dims.w, dims.h);
scalerGump->InitGump(0);
- Pentagram::Rect scaled_dims;
+ Rect scaled_dims;
scalerGump->GetDims(scaled_dims);
con->Print(MM_INFO, "Creating Graphics Console...\n");
@@ -1537,7 +1537,7 @@ void Ultima8Engine::syncSoundSettings() {
UltimaEngine::syncSoundSettings();
// Update music volume
- Pentagram::AudioMixer *audioMixer = Pentagram::AudioMixer::get_instance();
+ AudioMixer *audioMixer = AudioMixer::get_instance();
MidiPlayer *midiPlayer = audioMixer ? audioMixer->getMidiPlayer() : nullptr;
if (midiPlayer)
midiPlayer->setVolume(_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType));
@@ -1760,7 +1760,7 @@ void Ultima8Engine::save(ODataSource *ods) {
ods->write4(static_cast<uint32>(absoluteTime));
ods->write2(avatarMoverProcess->getPid());
- Pentagram::Palette *pal = PaletteManager::get_instance()->getPalette(PaletteManager::Pal_Game);
+ Palette *pal = PaletteManager::get_instance()->getPalette(PaletteManager::Pal_Game);
for (int i = 0; i < 12; i++) ods->write2(pal->matrix[i]);
ods->write2(pal->transform);
@@ -1789,8 +1789,8 @@ bool Ultima8Engine::load(IDataSource *ids, uint32 version) {
matrix[i] = ids->read2();
PaletteManager::get_instance()->transformPalette(PaletteManager::Pal_Game, matrix);
- Pentagram::Palette *pal = PaletteManager::get_instance()->getPalette(PaletteManager::Pal_Game);
- pal->transform = static_cast<Pentagram::PalTransforms>(ids->read2());
+ Palette *pal = PaletteManager::get_instance()->getPalette(PaletteManager::Pal_Game);
+ pal->transform = static_cast<PalTransforms>(ids->read2());
inversion = ids->read2();
@@ -1857,11 +1857,11 @@ void Ultima8Engine::ConCmd_changeGame(const Console::ArgvType &argv) {
void Ultima8Engine::ConCmd_listGames(const Console::ArgvType &argv) {
Ultima8Engine *app = Ultima8Engine::get_instance();
- Std::vector<Pentagram::istring> games;
+ Std::vector<istring> games;
games = app->settingman->listGames();
- Std::vector<Pentagram::istring>::iterator iter;
+ Std::vector<istring>::iterator iter;
for (iter = games.begin(); iter != games.end(); ++iter) {
- Pentagram::istring game = *iter;
+ istring game = *iter;
GameInfo *info = app->getGameInfo(game);
con->Printf(MM_INFO, "%s: ", game.c_str());
if (info) {
@@ -1931,7 +1931,7 @@ void Ultima8Engine::ConCmd_memberVar(const Console::ArgvType &argv) {
bool *b = 0;
int *i = 0;
Std::string *str = 0;
- Pentagram::istring *istr = 0;
+ istring *istr = 0;
// ini entry name if supported
const char *ini = 0;
diff --git a/engines/ultima/ultima8/ultima8.h b/engines/ultima/ultima8/ultima8.h
index a10d4cd..8f504ba 100644
--- a/engines/ultima/ultima8/ultima8.h
+++ b/engines/ultima/ultima8/ultima8.h
@@ -72,10 +72,7 @@ class AvatarMoverProcess;
class IDataSource;
class ODataSource;
struct Texture;
-
-namespace Pentagram {
class AudioMixer;
-}
class Ultima8Engine : public Shared::UltimaEngine, public CoreApp {
private:
@@ -123,7 +120,7 @@ private:
bool ttfoverrides;
// Audio Mixer
- Pentagram::AudioMixer *audiomixer;
+ AudioMixer *audiomixer;
private:
uint32 save_count;
@@ -147,7 +144,7 @@ private:
// full system
Game *game;
- Pentagram::istring change_gamename;
+ istring change_gamename;
Std::string error_message;
Std::string error_title;
@@ -221,7 +218,7 @@ protected:
*/
virtual bool isDataRequired(Common::String &folder, int &majorVersion, int &minorVersion) override;
public:
- Pentagram::PointScaler point_scaler;
+ PointScaler point_scaler;
public:
ENABLE_RUNTIME_CLASSTYPE()
@@ -239,11 +236,11 @@ public:
void startupGame();
void startupPentagramMenu();
void shutdownGame(bool reloading = true);
- void changeGame(Pentagram::istring newgame);
+ void changeGame(istring newgame);
// When in the Pentagram Menu, load minimal amount of data for the specific game
// Used to enable access to the games gumps and shapes
- void menuInitMinimal(Pentagram::istring game);
+ void menuInitMinimal(istring game);
void changeVideoMode(int width, int height, int fullscreen = -1); // -1 = no change, -2 = fullscreen toggle
RenderSurface *getRenderScreen() {
diff --git a/engines/ultima/ultima8/world/actors/animation_tracker.cpp b/engines/ultima/ultima8/world/actors/animation_tracker.cpp
index 2058c91..ecc3b6c 100644
--- a/engines/ultima/ultima8/world/actors/animation_tracker.cpp
+++ b/engines/ultima/ultima8/world/actors/animation_tracker.cpp
@@ -460,7 +460,7 @@ void AnimationTracker::checkWeaponHit() {
assert(a);
- Pentagram::Box abox = a->getWorldBox();
+ Box abox = a->getWorldBox();
abox.MoveAbs(x, y, z);
abox.MoveRel(x_fact[dir] * 32 * range, y_fact[dir] * 32 * range, 0);
@@ -487,7 +487,7 @@ void AnimationTracker::checkWeaponHit() {
Actor *item = getActor(itemid);
if (!item) continue;
- Pentagram::Box ibox = item->getWorldBox();
+ Box ibox = item->getWorldBox();
if (abox.Overlaps(ibox)) {
hit = itemid;
diff --git a/engines/ultima/ultima8/world/actors/main_actor.cpp b/engines/ultima/ultima8/world/actors/main_actor.cpp
index d696e61..379f4ac 100644
--- a/engines/ultima/ultima8/world/actors/main_actor.cpp
+++ b/engines/ultima/ultima8/world/actors/main_actor.cpp
@@ -382,7 +382,7 @@ void MainActor::ConCmd_mark(const Console::ArgvType &argv) {
int32 x, y, z;
mainactor->getLocation(x, y, z);
- Pentagram::istring confkey = "marks/" + argv[1];
+ istring confkey = "marks/" + argv[1];
char buf[100]; // large enough for 4 ints
sprintf(buf, "%d %d %d %d", curmap, x, y, z);
@@ -404,7 +404,7 @@ void MainActor::ConCmd_recall(const Console::ArgvType &argv) {
SettingManager *settings = SettingManager::get_instance();
MainActor *mainactor = getMainActor();
- Pentagram::istring confkey = "marks/" + argv[1];
+ istring confkey = "marks/" + argv[1];
Std::string target;
if (!settings->get(confkey, target)) {
pout << "recall: no such mark" << Std::endl;
@@ -423,9 +423,9 @@ void MainActor::ConCmd_recall(const Console::ArgvType &argv) {
void MainActor::ConCmd_listmarks(const Console::ArgvType &argv) {
SettingManager *settings = SettingManager::get_instance();
- Std::vector<Pentagram::istring> marks;
+ Std::vector<istring> marks;
marks = settings->listDataKeys("marks");
- for (Std::vector<Pentagram::istring>::iterator iter = marks.begin();
+ for (Std::vector<istring>::iterator iter = marks.begin();
iter != marks.end(); ++iter) {
pout << (*iter) << Std::endl;
}
diff --git a/engines/ultima/ultima8/world/actors/pathfinder.cpp b/engines/ultima/ultima8/world/actors/pathfinder.cpp
index cccdb2d..4e78cd6 100644
--- a/engines/ultima/ultima8/world/actors/pathfinder.cpp
+++ b/engines/ultima/ultima8/world/actors/pathfinder.cpp
@@ -250,7 +250,7 @@ static void drawbox(Item *item) {
Ultima8Engine::get_instance()->getGameMapGump()->GetCameraLocation(cx, cy, cz);
- Pentagram::Rect d;
+ Rect d;
screen->GetSurfaceDims(d);
int32 ix, iy, iz;
@@ -290,7 +290,7 @@ static void drawdot(int32 x, int32 y, int32 z, int size, uint32 rgb) {
Ultima8Engine::get_instance()->getGameMapGump()->GetCameraLocation(cx, cy, cz);
- Pentagram::Rect d;
+ Rect d;
screen->GetSurfaceDims(d);
x -= cx;
y -= cy;
@@ -307,7 +307,7 @@ static void drawedge(PathNode *from, PathNode *to, uint32 rgb) {
Ultima8Engine::get_instance()->getGameMapGump()->GetCameraLocation(cx, cy, cz);
- Pentagram::Rect d;
+ Rect d;
screen->GetSurfaceDims(d);
int32 x0, y0, x1, y1;
diff --git a/engines/ultima/ultima8/world/current_map.cpp b/engines/ultima/ultima8/world/current_map.cpp
index 981944f..4078796 100644
--- a/engines/ultima/ultima8/world/current_map.cpp
+++ b/engines/ultima/ultima8/world/current_map.cpp
@@ -49,7 +49,6 @@ namespace Ultima {
namespace Ultima8 {
using Std::list; // too messy otherwise
-using Pentagram::Rect;
typedef list<Item *> item_list;
const int INT_MAX_VALUE = 0x7fffffff;
@@ -346,7 +345,7 @@ static inline bool ChunkOnScreen(int32 cx, int32 cy, int32 sleft, int32 stop, in
static inline void CalcFastAreaLimits(int32 &sx_limit,
int32 &sy_limit,
int32 &xy_limit,
- const Pentagram::Rect &dims) {
+ const Rect &dims) {
// By default the fastArea is the screensize plus a border of no more
// than 256 pixels wide and 384 pixels high
// dims.w and dims.h need to be divided by 2 for crusader
@@ -381,7 +380,7 @@ void CurrentMap::updateFastArea(int32 from_x, int32 from_y, int32 from_z, int32
}
// Work out Fine (screenspace) Limits of chunks with half chunk border
- Pentagram::Rect dims;
+ Rect dims;
Ultima8Engine::get_instance()->getGameMapGump()->GetDims(dims);
int32 sleft = ((x_min - y_min) / 4) - (dims.w / 2 + mapChunkSize / 4);
diff --git a/engines/ultima/ultima8/world/item.cpp b/engines/ultima/ultima8/world/item.cpp
index b30a715..a4ecfe8 100644
--- a/engines/ultima/ultima8/world/item.cpp
+++ b/engines/ultima/ultima8/world/item.cpp
@@ -439,10 +439,10 @@ void Item::getCentre(int32 &X, int32 &Y, int32 &Z) const {
Z = z + shapeinfo->z * 4;
}
-Pentagram::Box Item::getWorldBox() const {
+Box Item::getWorldBox() const {
int32 xd, yd, zd;
getFootpadWorld(xd, yd, zd);
- return Pentagram::Box(x, y, z, xd, yd, zd);
+ return Box(x, y, z, xd, yd, zd);
}
bool Item::overlaps(Item &item2) const {
diff --git a/engines/ultima/ultima8/world/item.h b/engines/ultima/ultima8/world/item.h
index 7ce62df..eb8b430 100644
--- a/engines/ultima/ultima8/world/item.h
+++ b/engines/ultima/ultima8/world/item.h
@@ -130,7 +130,7 @@ public:
inline void getFootpadData(int32 &x, int32 &y, int32 &z) const;
//! Get the Box this item occupies in the world. Undef if item is contained
- Pentagram::Box getWorldBox() const;
+ Box getWorldBox() const;
//! Get flags
inline uint16 getFlags() const {
diff --git a/engines/ultima/ultima8/world/item_sorter.cpp b/engines/ultima/ultima8/world/item_sorter.cpp
index fc63cd0..e33c278 100644
--- a/engines/ultima/ultima8/world/item_sorter.cpp
+++ b/engines/ultima/ultima8/world/item_sorter.cpp
@@ -41,8 +41,6 @@
namespace Ultima {
namespace Ultima8 {
-using Pentagram::Rect;
-
// This does NOT need to be in the header
struct SortItem {
SortItem(SortItem *n) : next(n), prev(0), item_num(0), shape(0), order(-1), depends() { }
More information about the Scummvm-git-logs
mailing list