summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cd-tool.cpp3
-rw-r--r--gltest.cpp13
-rw-r--r--includes/cdutils.h2
-rw-r--r--includes/gltexture.h1
-rw-r--r--lib/cdutils.cpp6
-rw-r--r--mogltk/glbase.cpp1
-rw-r--r--mogltk/gltexture.cpp5
-rw-r--r--str-player.cpp16
8 files changed, 29 insertions, 18 deletions
diff --git a/cd-tool.cpp b/cd-tool.cpp
index 487a05f..38131b6 100644
--- a/cd-tool.cpp
+++ b/cd-tool.cpp
@@ -61,7 +61,8 @@ void showhelp(void) {
"Usage:\n"
"%s [-m <mode>] [-p <ppf file>] [-f] <isofile> <command> [command args]\n"
"Where mode can be 1 for MODE 1, 2 for MODE 2, 3 for MODE 2 FORM 1,\n"
-"4 for MODE 2 FORM 2 and 5 for autodetect, which is the default behaviour.\n"
+"4 for MODE 2 FORM 2, 5 for Raw, and 6 for autodetect, which is the\n"
+"default behaviour.\n"
"\n"
"Command can be one of:\n"
" infos - dumps a bunch of infos about the iso.\n"
diff --git a/gltest.cpp b/gltest.cpp
index 9991ba9..7965fa7 100644
--- a/gltest.cpp
+++ b/gltest.cpp
@@ -52,14 +52,19 @@ virtual int startup() throw (GeneralException) {
glVertex2f(561, 561);
glEnd();
+ mogltk::texture::Unbind();
glBegin(GL_TRIANGLE_STRIP);
- glTexCoord2i(0, 0);
+// glTexCoord2i(0, 0);
+ glColor3d(0, 0, 0);
glVertex2i(400, 100);
- glTexCoord2i(256, 0);
+// glTexCoord2i(256, 0);
+ glColor3d(1, 0, 0);
glVertex2i(450, 100);
- glTexCoord2i(0, 256);
+// glTexCoord2i(0, 256);
+ glColor3d(0, 1, 0);
glVertex2i(400, 150);
- glTexCoord2i(256, 256);
+// glTexCoord2i(256, 256);
+ glColor3d(0, 0, 1);
glVertex2i(450, 150);
glEnd();
mogltk::glbase::Leave2DMode();
diff --git a/includes/cdutils.h b/includes/cdutils.h
index 38eb118..0fe4638 100644
--- a/includes/cdutils.h
+++ b/includes/cdutils.h
@@ -25,7 +25,7 @@
#include "Handle.h"
-#define GUESS 5
+#define GUESS 6
extern const long sec_sizes[];
extern const long sec_offsts[];
diff --git a/includes/gltexture.h b/includes/gltexture.h
index 84edaa8..a094694 100644
--- a/includes/gltexture.h
+++ b/includes/gltexture.h
@@ -15,6 +15,7 @@ namespace mogltk {
void Bind(bool = true) throw (GeneralException);
GLuint GetWidth();
GLuint GetHeight();
+ static void Unbind(void);
private:
GLuint width, height, tex;
SDL_Surface * surface;
diff --git a/lib/cdutils.cpp b/lib/cdutils.cpp
index 0f7aa76..ff26358 100644
--- a/lib/cdutils.cpp
+++ b/lib/cdutils.cpp
@@ -26,9 +26,9 @@
#include "cdutils.h"
#include "Output.h"
-const long sec_sizes[6] = {0, 2048, 2336, 2048, 2324, 2352};
-const long sec_offsts[6] = {0, 16, 16, 24, 24, 0};
-const String sec_modes[6] = {"MODE 0 (empty)", "MODE 1", "MODE 2", "MODE 2 FORM 1", "MODE 2 FORM 2", "Autodetect"};
+const long sec_sizes[7] = {0, 2048, 2336, 2048, 2324, 2352, 2352};
+const long sec_offsts[7] = {0, 16, 16, 24, 24, 0, 0};
+const String sec_modes[7] = {"MODE 0 (empty)", "MODE 1", "MODE 2", "MODE 2 FORM 1", "MODE 2 FORM 2", "Raw", "Autodetect"};
cdutils::cdutils(Handle * r, Handle * w) : f_iso_r(r), f_iso_w(w), ppf_file(0), pt1(-1), pt2(-1), snum(0), ptl(0), root(0) {}
diff --git a/mogltk/glbase.cpp b/mogltk/glbase.cpp
index 11d15ae..5e63e86 100644
--- a/mogltk/glbase.cpp
+++ b/mogltk/glbase.cpp
@@ -59,7 +59,6 @@ int mogltk::glbase::setup(int w, int h, int flags) throw(GeneralException) {
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- glEnable(GL_TEXTURE_2D);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
diff --git a/mogltk/gltexture.cpp b/mogltk/gltexture.cpp
index 0549ee3..7949cb9 100644
--- a/mogltk/gltexture.cpp
+++ b/mogltk/gltexture.cpp
@@ -62,6 +62,7 @@ void mogltk::texture::Generate() throw (GeneralException) {
void mogltk::texture::Bind(bool expand) throw (GeneralException) {
if (surface)
throw GeneralException("Texture is not yet generated");
+ glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, tex);
if (expand) {
glMatrixMode(GL_TEXTURE);
@@ -78,3 +79,7 @@ GLuint mogltk::texture::GetWidth() {
GLuint mogltk::texture::GetHeight() {
return height;
}
+
+void mogltk::texture::Unbind(void) {
+ glDisable(GL_TEXTURE_2D);
+}
diff --git a/str-player.cpp b/str-player.cpp
index 7059900..caff4b9 100644
--- a/str-player.cpp
+++ b/str-player.cpp
@@ -73,19 +73,19 @@ void process_one_sector(Handle * f) {
f->read(sector, 2336);
h = (STR_Header *) ((Byte *) sector + 8);
-/* printm(M_INFO, "SubHeader: FN = %x, CN = %x, SM = %x, CI = %x: ", sector[0], sector[1], sector[2], sector[3]);
+ printm(M_INFO, "SubHeader: FN = %x, CN = %x, SM = %x, CI = %x: ", sector[0], sector[1], sector[2], sector[3]);
printm(M_BARE, "SubHeader FN : %x\n", sector[0]);
printm(M_BARE, "SubHeader CN : %x\n", sector[1]);
printm(M_BARE, "SubHeader SM : %x\n", sector[2]);
printm(M_BARE, "SubHeader CI : %x\n", sector[3]);
-*/
+
if ((channel != -1) && (channel != sector[1]))
return;
if ((sector[2] == 0x48) || (sector[2] == 0x42)) {
-// printm(M_BARE, "Video sector\n");
-/* printm(M_BARE, "Status : %04x\n", h->StSTATUS);
+ printm(M_BARE, "Video sector\n");
+ printm(M_BARE, "Status : %04x\n", h->StSTATUS);
printm(M_BARE, "Type : %04x\n", h->StTYPE);
printm(M_BARE, "Sector Offset: %i\n", h->StSECTOR_OFFSET);
printm(M_BARE, "Sector Size : %i\n", h->StSECTOR_SIZE);
@@ -95,7 +95,7 @@ void process_one_sector(Handle * f) {
printm(M_BARE, "Movie Height : %i\n", h->StMOVIE_HEIGHT);
printm(M_BARE, "Movie HeadM : %08x\n", h->StMOVIE_HEADM);
printm(M_BARE, "Movie HeadV : %08x\n", h->StMOVIE_HEADV);
- printm(M_BARE, "Channels : %04x\n", h->Channels); */
+ printm(M_BARE, "Channels : %04x\n", h->Channels);
if (h->StSECTOR_OFFSET == 0) {
video = (Byte *) malloc(h->StSECTOR_SIZE * 2016);
if (!screen) {
@@ -137,9 +137,9 @@ void process_one_sector(Handle * f) {
int locked = 0;
SoundSector * buffer = (SoundSector *) sector;
-// printm(M_BARE, "Audio sector\n");
-/* printm(M_BARE, "Frequency: %i\n", xahalfhz(buffer) ? 18900 : 37800);
- printm(M_BARE, "Channels : %s\n", xastereo(buffer) ? "stereo" : "mono"); */
+ printm(M_BARE, "Audio sector\n");
+ printm(M_BARE, "Frequency: %i\n", xahalfhz(buffer) ? 18900 : 37800);
+ printm(M_BARE, "Channels : %s\n", xastereo(buffer) ? "stereo" : "mono");
// fwrite(sector + 8, 1, 2324, stdout);
while (audio_len > 0) {