|
From: <dun...@us...> - 2006-07-24 09:50:22
|
Revision: 42 Author: dunkfordyce Date: 2006-07-24 02:50:09 -0700 (Mon, 24 Jul 2006) ViewCVS: http://svn.sourceforge.net/dunelegacy/?rev=42&view=rev Log Message: ----------- fixes for windows Modified Paths: -------------- branches/dunks/SConstruct branches/dunks/config.py branches/dunks/include/Font.h branches/dunks/src/Application.cpp branches/dunks/src/Font.cpp branches/dunks/src/main.cpp Modified: branches/dunks/SConstruct =================================================================== --- branches/dunks/SConstruct 2006-07-23 22:21:11 UTC (rev 41) +++ branches/dunks/SConstruct 2006-07-24 09:50:09 UTC (rev 42) @@ -1,4 +1,5 @@ import sys +import os opts = Options('config.py') # default to using sdl-config if not on windows @@ -9,37 +10,46 @@ opts.Add('ZZIP_INCLUDE_PATH', 'include path for zlib', '') opts.Add('ZZIP_LIB_PATH', 'lib path for zlib', '') -env = Environment(options = opts ) +opts.Add('BOOST_INCLUDE_PATH', 'include path for boost', '') +# need to get two paths as far as i can tell. these can probably be calculated somehow +opts.Add('BOOST_LIB_PATH', 'lib path for boost', '') + +if sys.platform == 'win32': + env = Environment(options = opts, ENV=os.environ) +else: + env = Environment(options = opts) + env.Append(CPPPATH="#include") if sys.platform != "win32": env.ParseConfig('sdl-config --cflags --libs') env.ParseConfig('pkg-config --cflags --libs zziplib') - env.Append(CCFLAGS=["-Wall", "-Werror"]) + env.Append(CCFLAGS=["-Wall", "-Werror", "-O2", "-ffast-math", "-funroll-loops"]) + env.Append(LINKFLAGS = ["-ffast-math"]) if 1: env.Append(CCFLAGS=["-ggdb"]) else: - env.Append(LIBS = ["zziplib", "zdll", "SDLmain"]) + env.Append(LIBS = ["zzipdll", "zdll", "SDLmain"]) env.Append(LINKFLAGS = ["/SUBSYSTEM:CONSOLE"]) - env.Append(CCFLAGS = ["/MD", "/Ox"]) + env.Append(CCFLAGS = ["/MD", "/O2"]) env.Append(LIBS = [ "SDL", "SDL_mixer", "SDL_image", "SDL_net", "SDL_ttf", - - "boost_signals", ]) env.Append(CPPPATH = [ "${SDL_INCLUDE_PATH}", "${ZLIB_INCLUDE_PATH}", - "${ZZIP_INCLUDE_PATH}"]) + "${ZZIP_INCLUDE_PATH}", + "${BOOST_INCLUDE_PATH}"]) env.Append(LIBPATH = [ "${SDL_LIB_PATH}", "${ZLIB_LIB_PATH}", - "${ZZIP_LIB_PATH}"]) + "${ZZIP_LIB_PATH}", + "${BOOST_LIB_PATH}"]) Export('env') Modified: branches/dunks/config.py =================================================================== --- branches/dunks/config.py 2006-07-23 22:21:11 UTC (rev 41) +++ branches/dunks/config.py 2006-07-24 09:50:09 UTC (rev 42) @@ -4,3 +4,5 @@ ZLIB_LIB_PATH = r"E:\projects\include\zlib123-dll\lib" ZZIP_INCLUDE_PATH = "E:\projects\include\zziplib-0.10.82-msvc6-lib\include" ZZIP_LIB_PATH = "E:\projects\include\zziplib-0.10.82-msvc6-lib\lib" +BOOST_INCLUDE_PATH = r"C:\Boost\include\boost-1_33_1" +BOOST_LIB_PATH = r"C:\Boost\lib" Modified: branches/dunks/include/Font.h =================================================================== --- branches/dunks/include/Font.h 2006-07-23 22:21:11 UTC (rev 41) +++ branches/dunks/include/Font.h 2006-07-24 09:50:09 UTC (rev 42) @@ -45,7 +45,7 @@ Font(FNTCharacter* characters, FNTHeader* header); ~Font(); - void render(const char* text, SDL_Surface* surface, Uint16 x, Uint16 y); + void render(const char* text, SDL_Surface* surface, Uint16 x, Uint16 y, Uint8 paloff); private: FNTHeader* m_header; Modified: branches/dunks/src/Application.cpp =================================================================== --- branches/dunks/src/Application.cpp 2006-07-23 22:21:11 UTC (rev 41) +++ branches/dunks/src/Application.cpp 2006-07-24 09:50:09 UTC (rev 42) @@ -28,6 +28,8 @@ #define SCREEN_BPP 8 #define VERSION "0.94.1" +Uint8 gpaloff; + Application::Application() { m_running = false; @@ -264,11 +266,13 @@ const int fps_interval = 10 * 1000; // 10 seconds float fps; - Font* fnt = FontManager::Instance()->getFont("intro.fnt"); + Font* fnt = FontManager::Instance()->getFont("new8p.fnt"); m_running = true; assert(m_rootWidget != NULL); + + gpaloff = 0 ; while (m_running) { @@ -293,7 +297,8 @@ m_rootWidget->draw(m_screen); - fnt->render("ABCDEFGHIJKLMOPQRSTUVWXYZ", m_screen, 10, 10); + fnt->render("ABCDEFGHIJKLMOPQRSTUVWXYZ", m_screen, 10, 10, gpaloff); + fnt->render("abcdefghijklmnopqrstuvwxz", m_screen, 10, 30, gpaloff); BlitCursor(); @@ -344,6 +349,11 @@ m_rootWidget->handleButtonUp( event.button.button, event.button.x, event.button.y); + if (event.button.button == 1) + gpaloff ++; + else + gpaloff --; + printf("gpla %u\n", gpaloff); break; case SDL_KEYDOWN: m_rootWidget->handleKeyDown(&(event.key.keysym)); Modified: branches/dunks/src/Font.cpp =================================================================== --- branches/dunks/src/Font.cpp 2006-07-23 22:21:11 UTC (rev 41) +++ branches/dunks/src/Font.cpp 2006-07-24 09:50:09 UTC (rev 42) @@ -17,20 +17,20 @@ delete m_header; }; -void Font::render(const char* text, SDL_Surface* surface, Uint16 offx, Uint16 offy) +void Font::render(const char* text, SDL_Surface* surface, Uint16 offx, Uint16 offy, Uint8 paloff) { FNTCharacter* ch; byte* bitmap; Uint8* pixels = (Uint8*)surface->pixels; - + for (unsigned int c=0; c!=strlen(text); c++) { - printf("char %c\n", text[c]); ch = &m_characters[text[c]]; bitmap = ch->bitmap; byte ox; + /* for (byte y=0; y!=ch->y_offset; y++) { ox = offx; @@ -42,6 +42,7 @@ ++ox; }; }; + */ for (byte y=0; y!=ch->height; y++) { @@ -72,22 +73,21 @@ printf("."); */ - //if (hibyte!=0) + if (hibyte!=0) { - pixels[(offx + x) + ((ch->y_offset + y + offy) * surface->w)] = Uint8(hibyte); + pixels[(offx + x) + ((ch->y_offset + y + offy) * surface->w)] = paloff + Uint8(hibyte); }; - //if (2 < ch->width) lobyte!=0) + if (lobyte!=0) //(2 < ch->width) lobyte!=0) { - pixels[(offx + x + 1) + ((ch->y_offset + y + offy) * surface->w)] = Uint8(lobyte); + pixels[(offx + x + 1) + ((ch->y_offset + y + offy) * surface->w)] = paloff + Uint8(lobyte); }; }; - printf("\n"); }; offx += (2*ch->width) + 1; }; - + }; FontManager::FontManager() Modified: branches/dunks/src/main.cpp =================================================================== --- branches/dunks/src/main.cpp 2006-07-23 22:21:11 UTC (rev 41) +++ branches/dunks/src/main.cpp 2006-07-24 09:50:09 UTC (rev 42) @@ -1,6 +1,15 @@ #include "Application.h" #include "Settings.h" +namespace boost { + + void throw_exception(std::exception const & e) + { + + }; + +} + int main(int argc, char *argv[]) { Settings::Instance()->ParseFile("dunelegacy.cfg"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |