diff --git a/.gitignore b/.gitignore index 7cf332ee5..092a0b9eb 100644 --- a/.gitignore +++ b/.gitignore @@ -14,5 +14,7 @@ Saves/* generated/* generate Makefile.me -PowderToypp.xcodeproj/* +*.xcodeproj .DS_Store +*.plist +*.lproj diff --git a/Makefile b/Makefile index 814d77e9f..a6d09828d 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,9 @@ HEADERS := $(wildcard src/*.h) $(wildcard src/*/*.h) $(wildcard generated/*.h) SOURCES := $(wildcard src/*.cpp) $(wildcard src/*/*.cpp) $(wildcard src/*/*/*.cpp) $(wildcard generated/*.cpp) +GENERATEDSOURCES := $(wildcard src/*/*/*.h) $(wildcard src/*/*/*.cpp) OBJS := $(patsubst src/%.cpp,build/obj/%.o,$(SOURCES)) -NEWLINE := $(`echo "d\nd"`) -ELEMENTFILES := $(patsubst src/simulation/%,\#include "%"$(NEWLINE),$(wildcard src/simulation/elements/*.cpp)) -#ELEMENTFILES := \#include "elements/watr.cpp" - -FOLDERS := - CFLAGS := -w -Isrc/ -Idata/ -Igenerated/ OFLAGS := -fkeep-inline-functions @@ -73,7 +68,8 @@ buildpaths-powder-x: $(shell mkdir -p build/obj/powder-x/) $(shell mkdir -p $(sort $(dir $(patsubst build/obj/%.o,build/obj/powder-x/%.o,$(OBJS))))) -generate: +generate: $(GENERATEDSOURCES) + touch generate python generator.py clean: diff --git a/data/hmap.h b/data/hmap.h index 605f28be9..61a1072f8 100644 --- a/data/hmap.h +++ b/data/hmap.h @@ -19,7 +19,7 @@ */ #ifndef HMAP_H #define HMAP_H -#include +#include "Graphics.h" static char color_data[] = {0x2B,0x00,0xFF,0x2B,0x00,0xFF,0x28,0x04,0xFF,0x24,0x08,0xFF,0x20,0x0D,0xFF,0x1C,0x12,0xFF,0x17,0x18,0xFF,0x12,0x1E,0xFF,0x0D,0x25,0xFF,0x07,0x2D,0xFF,0x03,0x35,0xFF,0x01,0x3E,0xFF,0x00,0x42,0xFF,0x00,0x44,0xFF,0x00,0x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FF,0x48,0x00,0xFF,0x46,0x00,0xFF,0x45,0x00,0xFF,0x43,0x00,0xFF,0x40,0x00,0xFF,0x3F,0x00,0xFF,0x3C,0x00,0xFF,0x3B,0x00,0xFF,0x39,0x00,0xFF,0x37,0x00,0xFF,0x35,0x00,0xFF,0x33,0x00,0xFF,0x32,0x00,0xFF,0x30,0x00,0xFF,0x2F,0x00,0xFF,0x2D,0x00,0xFF,0x2B,0x00,0xFF,0x2A,0x00,0xFF,0x28,0x00,0xFF,0x27,0x00,0xFF,0x25,0x00,0xFF,0x23,0x00,0xFF,0x22,0x00,0xFF,0x21,0x00,0xFF,0x1F,0x00,0xFF,0x1E,0x00,0xFF,0x1C,0x00,0xFF,0x1B,0x00,0xFF,0x1A,0x00,0xFF,0x19,0x00,0xFF,0x18,0x00,0xFF,0x16,0x00,0xFF,0x16,0x01,0xFF,0x15,0x02,0xFF,0x14,0x02,0xFF,0x12,0x02,0xFF,0x12,0x03,0xFF,0x12,0x04,0xFF,0x10,0x05,0xFF,0x10,0x06,0xFF,0x0F,0x06,0xFF,0x0F,0x07,0xFF,0x0D,0x08,0xFF,0x0D,0x09,0xFF,0x0C,0x0A,0xFF,0x0C,0x0B,0xFF,0x0C,0x0C,0xFF,0x0B,0x0C,0xFF,0x0B,0x0E,0xFF,0x0A,0x0F,0xFF,0x09,0x10,0xFF,0x09,0x11,0xFF,0x08,0x12,0xFF,0x08,0x13,0xFF,0x08,0x14,0xFF,0x07,0x15,0xFF,0x07,0x16,0xFF,0x06,0x18,0xFF,0x06,0x19,0xFF,0x06,0x1A,0xFF,0x06,0x1C,0xFF,0x06,0x1D,0xFF,0x06,0x1E,0xFF,0x05,0x1F,0xFF,0x05,0x20,0xFF,0x05,0x21,0xFF,0x05,0x23,0xFF,0x04,0x24,0xFF,0x04,0x25,0xFF,0x04,0x26,0xFF,0x04,0x28,0xFF,0x03,0x29,0xFF,0x03,0x2B,0xFF,0x03,0x2B,0xFF,0x03,0x2D,0xFF,0x03,0x2E,0xFF,0x03,0x30,0xFF,0x03,0x31,0xFF,0x02,0x32,0xFF,0x03,0x34,0xFF,0x03,0x35,0xFF,0x02,0x37,0xFF,0x03,0x39,0xFF,0x02,0x3A,0xFF,0x02,0x3B,0xFF,0x01,0x3C,0xFF,0x01,0x3E,0xFF,0x01,0x3F,0xFF,0x01,0x40,0xFF,0x02,0x42,0xFF,0x02,0x44,0xFF,0x01,0x45,0xFF,0x01,0x46,0xFF,0x01,0x48,0xFF,0x01,0x49,0xFF,0x01,0x4A,0xFF,0x01,0x4C,0xFF,0x00,0x4E,0xFF,0x01,0x4E,0xFF,0x00,0x50,0xFF,0x01,0x52,0xFF,0x01,0x52,0xFF,0x00,0x54,0xFF,0x00,0x55,0xFF,0x00,0x56,0xFF,0x00,0x58,0xFF,0x00,0x58,0xFF,0x00,0x59,0xFF,0x00,0x5A,0xFF,0x00,0x5B,0xFF,0x00,0x5C,0xFF,0x00,0x5D,0xFF,0x00,0x5E,0xFF,0x00,0x5F,0xFF,0x00,0x60,0xFF,0x00,0x61,0xFF,0x00,0x62,0xFF,0x00,0x63,0xFF,0x00,0x64,0xFF,0x00,0x65,0xFF,0x00,0x66,0xFF,0x00,0x67,0xFF,0x00,0x69,0xFF,0x00,0x6A,0xFF,0x00,0x6A,0xFF,0x00,0x6B,0xFF,0x00,0x6C,0xFF,0x00,0x6E,0xFF,0x00,0x6F,0xFF,0x00,0x70,0xFF,0x00,0x71,0xFF,0x00,0x72,0xFF,0x00,0x73,0xFF,0x00,0x74,0xFF,0x00,0x75,0xFF,0x00,0x76,0xFF,0x00,0x77,0xFF,0x00,0x79,0xFF,0x00,0x7A,0xFF,0x00,0x7B,0xFF,0x00,0x7B,0xFF,0x00,0x7D,0xFF,0x00,0x7E,0xFF,0x00,0x7F,0xFF,0x00,0x80,0xFF,0x00,0x82,0xFF,0x00,0x83,0xFF,0x00,0x83,0xFF,0x00,0x84,0xFF,0x00,0x86,0xFF,0x00,0x87,0xFF,0x00,0x88,0xFF,0x00,0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,0x00,0xFF,0x9F,0x00,0xFF,0x9E,0x00,0xFF,0x9D,0x00,0xFF,0x9D,0x00,0xFF,0x9B,0x00,0xFF,0x9B,0x00,0xFF,0x99,0x00,0xFF,0x98,0x00,0xFF,0x98,0x00,0xFF,0x97,0x00,0xFF,0x95,0x00,0xFF,0x94,0x00,0xFF,0x93,0x00,0xFF,0x93,0x00,0xFF,0x92,0x00,0xFF,0x91,0x00,0xFF,0x90,0x00,0xFF,0x8F,0x00,0xFF,0x8E,0x00,0xFF,0x8D,0x00,0xFF,0x8C,0x00,0xFF,0x8B,0x00,0xFF,0x8A,0x00,0xFF,0x89,0x00,0xFF,0x89,0x00,0xFF,0x88,0x00,0xFF,0x87,0x00,0xFF,0x86,0x00,0xFF,0x84,0x00,0xFF,0x84,0x00,0xFF,0x82,0x00,0xFF,0x82,0x00,0xFF,0x81,0x00,0xFF,0x80,0x00,0xFF,0x7F,0x00,0xFF,0x7E,0x00,0xFF,0x7D,0x00,0xFF,0x7C,0x00,0xFF,0x7B,0x00,0xFF,0x7B,0x00,0xFF,0x7A,0x00,0xFF,0x78,0x00,0xFF,0x78,0x00,0xFF,0x77,0x00,0xFF,0x76,0x00,0xFF,0x74,0x00,0xFF,0x74,0x00,0xFF,0x73,0x00,0xFF,0x72,0x00,0xFF,0x71,0x00,0xFF,0x70,0x00,0xFF,0x70,0x00,0xFF,0x6E,0x00,0xFF,0x6D,0x00,0xFF,0x6C,0x00,0xFF,0x6C,0x00,0xFF,0x6B,0x00,0xFF,0x6A,0x00,0xFF,0x6A,0x00,0xFF,0x68,0x00,0xFF,0x67,0x00,0xFF,0x66,0x00,0xFF,0x66,0x00,0xFF,0x65,0x00,0xFF,0x64,0x00,0xFF,0x64,0x00,0xFF,0x62,0x00,0xFF,0x62,0x00,0xFF,0x61,0x00,0xFF,0x60,0x00,0xFF,0x5F,0x00,0xFF,0x5E,0x00,0xFF,0x5D,0x00,0xFF,0x5D,0x00,0xFF,0x5C,0x00,0xFF,0x5A,0x00,0xFF,0x5A,0x00,0xFF,0x59,0x00,0xFF,0x58,0x00,0xFF,0x57,0x00,0xFF,0x56,0x00,0xFF,0x55,0x00,0xFF,0x54,0x00,0xFF,0x54,0x00,0xFF,0x53,0x00,0xFF,0x52,0x00,0xFF,0x51,0x00,0xFF,0x50,0x00,0xFF,0x4F,0x00,0xFF,0x4E,0x00,0xFF,0x4D,0x00,0xFF,0x4D,0x00,0xFF,0x4C,0x00,0xFF,0x4A,0x00,0xFF,0x4A,0x00,0xFF,0x48,0x00,0xFF,0x47,0x00,0xFF,0x47,0x00,0xFF,0x45,0x00,0xFF,0x45,0x00,0xFF,0x44,0x00,0xFF,0x43,0x00,0xFF,0x43,0x00,0xFF,0x41,0x00,0xFF,0x40,0x00,0xFF,0x40,0x00,0xFF,0x3F,0x00,0xFF,0x3E,0x00,0xFF,0x3C,0x00,0xFF,0x3C,0x00,0xFF,0x3B,0x00,0xFF,0x3A,0x00,0xFF,0x38,0x00,0xFF,0x38,0x00,0xFF,0x37,0x00,0xFF,0x36,0x00,0xFF,0x35,0x00,0xFF,0x34,0x00,0xFF,0x34,0x00,0xFF,0x33,0x00,0xFF,0x31,0x00,0xFF,0x31,0x00,0xFF,0x2F,0x00,0xFF,0x2F,0x00,0xFF,0x2E,0x00,0xFF,0x2C,0x00,0xFF,0x2C,0x00,0xFF,0x2B,0x00,0xFF,0x2A,0x00,0xFF,0x29,0x00,0xFF,0x28,0x00,0xFF,0x27,0x00,0xFF,0x26,0x00,0xFF,0x26,0x00,0xFF,0x25,0x00,0xFF,0x25,0x00,0xFF,0x23,0x00,0xFF,0x23,0x00,0xFF,0x22,0x00,0xFF,0x21,0x00,0xFF,0x20,0x00,0xFF,0x1F,0x00,0xFF,0x1E,0x00,0xFF,0x1D,0x00,0xFF,0x1D,0x00,0xFF,0x1C,0x00,0xFF,0x1B,0x00,0xFF,0x1A,0x00,0xFF,0x19,0x00,0xFF,0x19,0x00,0xFF,0x18,0x00,0xFF,0x17,0x00,0xFF,0x16,0x00,0xFF,0x15,0x00,0xFF,0x15,0x00,0xFF,0x14,0x00,0xFF,0x14,0x00,0xFF,0x12,0x00,0xFF,0x12,0x00,0xFF,0x12,0x00,0xFF,0x10,0x00,0xFF,0x10,0x00,0xFF,0x0F,0x00,0xFF,0x0E,0x00,0xFF,0x0E,0x00,0xFF,0x0D,0x00,0xFF,0x0C,0x00,0xFF,0x0B,0x00,0xFF,0x0B,0x00,0xFF,0x0B,0x00,0xFF,0x0A,0x00,0xFF,0x09,0x00,0xFF,0x09,0x00,0xFF,0x08,0x00,0xFF,0x07,0x00,0xFF,0x07,0x00,0xFF,0x06,0x00,0xFF,0x06,0x00,0xFF,0x05,0x00,0xFF,0x04,0x00,0xFF,0x04,0x00,0xFF,0x04,0x00,0xFF,0x04,0x00,0xFF,0x03,0x00,0xFF,0x03,0x00,0xFF,0x02,0x00,0xFF,0x01,0x00,0xFF,0x01,0x00,0xFF,0x01,0x00,0xFF,0x00,0x00,0xFF,0x00,0x00,0xFF,0x00,0x01,0xFF,0x00,0x01,0xFF,0x00,0x02,0xFF,0x00,0x01,0xFF,0x00,0x02,0xFF,0x00,0x03,0xFF,0x00,0x03,0xFF,0x00,0x03,0xFF,0x00,0x04,0xFF,0x00,0x05,0xFF,0x00,0x05,0xFF,0x00,0x05,0xFF,0x00,0x06,0xFF,0x00,0x07,0xFF,0x00,0x06,0xFF,0x00,0x07,0xFF,0x00,0x08,0xFF,0x00,0x09,0xFF,0x00,0x09,0xFF,0x00,0x09,0xFF,0x00,0x0B,0xFF,0x00,0x0B,0xFF,0x00,0x0C,0xFF,0x00,0x0B,0xFF,0x00,0x0C,0xFF,0x00,0x0E,0xFF,0x00,0x0D,0xFF,0x00,0x0E,0xFF,0x00,0x0F,0xFF,0x00,0x0F,0xFF,0x00,0x10,0xFF,0x00,0x11,0xFF,0x00,0x11,0xFF,0x00,0x12,0xFF,0x00,0x13,0xFF,0x00,0x14,0xFF,0x00,0x14,0xFF,0x00,0x15,0xFF,0x00,0x16,0xFF,0x00,0x16,0xFF,0x00,0x17,0xFF,0x00,0x17,0xFF,0x00,0x18,0xFF,0x00,0x19,0xFF,0x00,0x1A,0xFF,0x00,0x1A,0xFF,0x00,0x1B,0xFF,0x00,0x1C,0xFF,0x00,0x1D,0xFF,0x00,0x1E,0xFF,0x00,0x1E,0xFF,0x00,0x1F,0xFF,0x00,0x20,0xFF,0x00,0x21,0xFF,0x00,0x22,0xFF,0x00,0x22,0xFF,0x00,0x22,0xFF,0x00,0x24,0xFF,0x00,0x25,0xFF,0x00,0x26,0xFF,0x00,0x26,0xFF,0x00,0x27,0xFF,0x00,0x27,0xFF,0x00,0x28,0xFF,0x00,0x2A,0xFF,0x00,0x2A,0xFF,0x00,0x2B,0xFF,0x00,0x2C,0xFF,0x00,0x2C,0xFF,0x00,0x2E,0xFF,0x00,0x2E,0xFF,0x00,0x2F,0xFF,0x00,0x30,0xFF,0x00,0x31,0xFF,0x00,0x31,0xFF,0x00,0x32,0xFF,0x00,0x33,0xFF,0x00,0x34,0xFF,0x00,0x35,0xFF,0x00,0x36,0xFF,0x00,0x37,0xFF,0x00,0x37,0xFF,0x00,0x39,0xFF,0x00,0x3A,0xFF,0x00,0x3A,0xFF,0x00,0x3B,0xFF,0x00,0x3C,0xFF,0x00,0x3D,0xFF,0x00,0x3E,0xFF,0x00,0x3E,0xFF,0x00,0x3F,0xFF,0x00,0x40,0xFF,0x00,0x41,0xFF,0x00,0x42,0xFF,0x00,0x43,0xFF,0x00,0x43,0xFF,0x00,0x45,0xFF,0x00,0x46,0xFF,0x00,0x46,0xFF,0x00,0x47,0xFF,0x00,0x48,0xFF,0x00,0x49,0xFF,0x00,0x4A,0xFF,0x00,0x4B,0xFF,0x00,0x4C,0xFF,0x00,0x4C,0xFF,0x00,0x4D,0xFF,0x00,0x4E,0xFF,0x00,0x4F,0xFF,0x00,0x50,0xFF,0x00,0x51,0xFF,0x00,0x51,0xFF,0x00,0x52,0xFF,0x00,0x53,0xFF,0x00,0x54,0xFF,0x00,0x54,0xFF,0x00,0x56,0xFF,0x00,0x56,0xFF,0x00,0x57,0xFF,0x00,0x59,0xFF,0x00,0x59,0xFF,0x00,0x5A,0xFF,0x00,0x5A,0xFF,0x00,0x5C,0xFF,0x00,0x5D,0xFF,0x00,0x5D,0xFF,0x00,0x5E,0xFF,0x00,0x5F,0xFF,0x00,0x60,0xFF,0x00,0x61,0xFF,0x00,0x61,0xFF,0x00,0x62,0xFF,0x00,0x63,0xFF,0x00,0x64,0xFF,0x00,0x64,0xFF,0x00,0x65,0xFF,0x00,0x66,0xFF,0x00,0x67,0xFF,0x00,0x67,0xFF,0x00,0x68,0xFF,0x00,0x69,0xFF,0x00,0x6A,0xFF,0x00,0x6B,0xFF,0x00,0x6B,0xFF,0x00,0x6C,0xFF,0x00,0x6C,0xFF,0x00,0x6D,0xFF,0x00,0x6E,0xFF,0x00,0x6F,0xFF,0x00,0x6F,0xFF,0x00,0x70,0xFF,0x00,0x71,0xFF,0x00,0x72,0xFF,0x00,0x72,0xFF,0x00,0x73,0xFF,0x00,0x74,0xFF,0x00,0x74,0xFF,0x00,0x75,0xFF,0x00,0x76,0xFF,0x00,0x77,0xFF,0x00,0x78,0xFF,0x00,0x78,0xFF,0x00,0x79,0xFF,0x00,0x7A,0xFF,0x00,0x7A,0xFF,0x00,0x7B,0xFF,0x00,0x7C,0xFF,0x00,0x7D,0xFF,0x00,0x7E,0xFF,0x00,0x7E,0xFF,0x00,0x80,0xFF,0x00,0x80,0xFF,0x00,0x81,0xFF,0x00,0x82,0xFF,0x00,0x82,0xFF,0x00,0x83,0xFF,0x00,0x84,0xFF,0x00,0x85,0xFF,0x00,0x85,0xFF,0x00,0x87,0xFF,0x00,0x87,0xFF,0x00,0x88,0xFF,0x00,0x89,0xFF,0x00,0x8A,0xFF,0x00,0x8A,0xFF,0x00,0x8B,0xFF,0x00,0x8C,0xFF,0x00,0x8D,0xFF,0x00,0x8E,0xFF,0x00,0x8F,0xFF,0x00,0x90,0xFF,0x00,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0xC7,0xFF,0x00,0xC7,0xFF,0x00,0xC7,0xFF,0x00,0xC8,0xFF,0x00,0xC9,0xFF,0x00,0xC9,0xFF,0x00,0xCA,0xFF,0x00,0xCA,0xFF,0x00,0xCB,0xFF,0x00,0xCC,0xFF,0x00,0xCC,0xFF,0x00,0xCC,0xFF,0x00,0xCD,0xFF,0x00,0xCD,0xFF,0x00,0xCE,0xFF,0x00,0xCE,0xFF,0x00,0xCF,0xFF,0x00,0xCF,0xFF,0x00,0xD0,0xFF,0x00,0xD0,0xFF,0x00,0xD1,0xFF,0x00,0xD1,0xFF,0x00,0xD1,0xFF,0x00,0xD2,0xFF,0x00,0xD2,0xFF,0x00,0xD3,0xFF,0x00,0xD3,0xFF,0x00,0xD4,0xFF,0x00,0xD3,0xFF,0x00,0xD4,0xFF,0x00,0xD4}; //1024 Pixels //static char plasma_data[] = {0x00,0x00,0x00,0x03,0x00,0x00,0x05,0x00,0x00,0x09,0x00,0x00,0x0E,0x00,0x00,0x12,0x00,0x00,0x17,0x00,0x00,0x1C,0x00,0x00,0x22,0x00,0x00,0x27,0x00,0x00,0x2C,0x00,0x00,0x32,0x00,0x00,0x37,0x00,0x00,0x3C,0x00,0x00,0x41,0x00,0x00,0x45,0x00,0x00,0x4A,0x00,0x00,0x4D,0x00,0x00,0x51,0x00,0x00,0x53,0x00,0x00,0x55,0x00,0x00,0x55,0x00,0x02,0x55,0x02,0x03,0x55,0x03,0x06,0x55,0x03,0x07,0x55,0x05,0x09,0x55,0x06,0x0C,0x55,0x06,0x0F,0x55,0x07,0x10,0x55,0x09,0x13,0x55,0x0A,0x16,0x55,0x0C,0x1A,0x55,0x0C,0x1D,0x54,0x0E,0x20,0x53,0x10,0x23,0x54,0x11,0x26,0x53,0x13,0x2A,0x52,0x14,0x2E,0x51,0x15,0x31,0x50,0x17,0x35,0x50,0x19,0x38,0x4E,0x1A,0x3D,0x4D,0x1C,0x40,0x4D,0x1D,0x44,0x4C,0x1F,0x47,0x4B,0x21,0x4C,0x4A,0x23,0x4F,0x49,0x24,0x54,0x48,0x25,0x57,0x47,0x28,0x5B,0x46,0x29,0x5F,0x45,0x2B,0x62,0x44,0x2D,0x66,0x44,0x2E,0x6A,0x43,0x30,0x6E,0x42,0x32,0x72,0x41,0x33,0x76,0x40,0x35,0x79,0x3F,0x38,0x7C,0x3F,0x39,0x7F,0x3E,0x3B,0x83,0x3D,0x3D,0x86,0x3C,0x3F,0x8A,0x3B,0x40,0x8C,0x3B,0x43,0x8F,0x3B,0x44,0x92,0x3A,0x46,0x95,0x39,0x48,0x98,0x39,0x4A,0x9B,0x39,0x4C,0x9C,0x39,0x4E,0x9F,0x3A,0x4F,0xA1,0x39,0x51,0xA3,0x39,0x52,0xA4,0x39,0x54,0xA6,0x39,0x56,0xA7,0x39,0x57,0xA8,0x39,0x58,0xA8,0x3A,0x5A,0xA9,0x3A,0x5C,0xA8,0x3A,0x5D,0xA8,0x3B,0x5F,0xA8,0x3C,0x61,0xA8,0x3D,0x62,0xA8,0x3D,0x64,0xA9,0x3E,0x66,0xA8,0x3E,0x67,0xA9,0x3F,0x68,0xA8,0x40,0x6A,0xA8,0x41,0x6C,0xA8,0x42,0x6E,0xA8,0x42,0x70,0xA8,0x43,0x71,0xA8,0x44,0x73,0xA8,0x45,0x74,0xA9,0x46,0x76,0xA8,0x48,0x79,0xA8,0x49,0x7A,0xA7,0x4A,0x7C,0xA6,0x4A,0x7D,0xA5,0x4C,0x7F,0xA4,0x4D,0x81,0xA3,0x4E,0x83,0xA2,0x4E,0x85,0xA1,0x50,0x86,0xA0,0x51,0x88,0x9F,0x52,0x8A,0x9D,0x53,0x8B,0x9D,0x55,0x8D,0x9B,0x56,0x8F,0x9A,0x57,0x91,0x98,0x58,0x92,0x98,0x5A,0x94,0x97,0x5B,0x96,0x95,0x5C,0x97,0x94,0x5E,0x99,0x93,0x5F,0x9A,0x91,0x60,0x9C,0x90,0x61,0x9D,0x90,0x62,0x9F,0x8E,0x64,0xA1,0x8D,0x65,0xA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BF,0xC0,0xC4,0xC0,0xC1,0xC4,0xC1,0xC2,0xC4,0xC2,0xC2,0xC4,0xC3,0xC4,0xC4,0xC3,0xC4,0xC4,0xC4}; //200 Pixels static char hflm_data[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x02,0x01,0x01,0x02,0x02,0x01,0x04,0x02,0x01,0x04,0x02,0x03,0x05,0x03,0x03,0x07,0x04,0x04,0x08,0x04,0x03,0x09,0x04,0x04,0x0B,0x05,0x04,0x0C,0x05,0x05,0x0D,0x06,0x05,0x0E,0x07,0x06,0x10,0x07,0x07,0x11,0x08,0x07,0x12,0x09,0x08,0x14,0x09,0x08,0x15,0x0A,0x09,0x17,0x0A,0x09,0x19,0x0B,0x0A,0x1A,0x0C,0x0A,0x1C,0x0D,0x0B,0x1D,0x0D,0x0B,0x1F,0x0D,0x0C,0x22,0x0F,0x0D,0x23,0x0F,0x0E,0x25,0x10,0x0E,0x26,0x11,0x0F,0x28,0x12,0x10,0x2A,0x13,0x10,0x2C,0x13,0x11,0x2E,0x14,0x12,0x2F,0x15,0x12,0x31,0x15,0x13,0x33,0x16,0x14,0x35,0x17,0x15,0x36,0x18,0x15,0x39,0x19,0x16,0x3B,0x19,0x17,0x3D,0x1B,0x17,0x3E,0x1B,0x18,0x40,0x1C,0x19,0x42,0x1D,0x1A,0x43,0x1D,0x1B,0x45,0x1E,0x1C,0x47,0x1F,0x1C,0x49,0x20,0x1D,0x4B,0x21,0x1F,0x4C,0x21,0x1F,0x4E,0x22,0x20,0x50,0x23,0x21,0x52,0x23,0x22,0x53,0x24,0x23,0x55,0x25,0x23,0x56,0x26,0x24,0x59,0x26,0x25,0x5A,0x27,0x26,0x5B,0x28,0x27,0x5D,0x28,0x28,0x5E,0x29,0x29,0x60,0x29,0x2A,0x62,0x2A,0x2B,0x63,0x2B,0x2C,0x64,0x2C,0x2E,0x65,0x2C,0x2E,0x66,0x2C,0x2F,0x68,0x2D,0x31,0x69,0x2E,0x32,0x6A,0x2F,0x32,0x6B,0x2F,0x34,0x6C,0x30,0x34,0x6D,0x30,0x35,0x6F,0x31,0x37,0x70,0x31,0x38,0x71,0x32,0x39,0x72,0x33,0x3B,0x73,0x33,0x3C,0x74,0x34,0x3D,0x75,0x35,0x3E,0x76,0x35,0x3F,0x78,0x36,0x41,0x78,0x36,0x42,0x79,0x36,0x43,0x7A,0x37,0x44,0x7B,0x37,0x46,0x7C,0x38,0x48,0x7D,0x39,0x48,0x7E,0x3A,0x49,0x7F,0x39,0x4B,0x80,0x3A,0x4C,0x81,0x3B,0x4E,0x82,0x3C,0x4F,0x83,0x3C,0x51,0x84,0x3C,0x52,0x84,0x3D,0x54,0x86,0x3E,0x55,0x87,0x3E,0x56,0x88,0x3F,0x57,0x89,0x40,0x59,0x8A,0x40,0x5A,0x8A,0x41,0x5C,0x8B,0x41,0x5D,0x8C,0x42,0x5F,0x8D,0x41,0x60,0x8E,0x42,0x62,0x8E,0x42,0x62,0x8F,0x44,0x65,0x90,0x43,0x65,0x91,0x45,0x67,0x91,0x44,0x69,0x92,0x45,0x6A,0x93,0x46,0x6B,0x94,0x46,0x6C,0x94,0x46,0x6E,0x96,0x47,0x70,0x96,0x48,0x70,0x97,0x48,0x72,0x98,0x48,0x73,0x99,0x49,0x74,0x99,0x49,0x76,0x9A,0x4A,0x77,0x9A,0x4B,0x78,0x9B,0x4B,0x7A,0x9C,0x4B,0x7B,0x9D,0x4B,0x7C,0x9E,0x4C,0x7D,0x9F,0x4C,0x7E,0x9F,0x4D,0x7F,0xA0,0x4E,0x80,0xA0,0x4E,0x82,0xA1,0x4E,0x83,0xA2,0x4F,0x84,0xA3,0x4F,0x85,0xA3,0x4F,0x86,0xA4,0x4F,0x88,0xA5,0x50,0x89,0xA5,0x50,0x89,0xA6,0x51,0x8B,0xA6,0x51,0x8B,0xA7,0x51,0x8D,0xA8,0x51,0x8E,0xA9,0x52,0x8F,0xAA,0x52,0x90,0xAA,0x53,0x92,0xAB,0x53,0x92,0xAB,0x53,0x93,0xAC,0x54,0x95,0xAD,0x53,0x95,0xAE,0x54,0x96,0xAE,0x55,0x98,0xAE,0x54,0x98,0xAF,0x55,0x9A,0xB0,0x56,0x9B,0xB0,0x56,0x9C,0xB1,0x56,0x9D,0xB1,0x56,0x9E,0xB2,0x56,0xA0,0xB3,0x57,0xA0,0xB3,0x57,0xA1,0xB3,0x57,0xA2,0xB4,0x58,0xA3,0xB4,0x58,0xA4,0xB5,0x57,0xA5,0xB6,0x58,0xA6,0xB6,0x58,0xA7,0xB7,0x58,0xA8,0xB7,0x59,0xA9,0xB8,0x58,0xAA,0xB9,0x5A,0xAB,0xB9,0x59,0xAC,0xBA,0x5A,0xAD,0xBA,0x5A,0xAE,0xBB,0x5A,0xAF,0xBB,0x5A,0xB0,0xBC,0x5B,0xB0,0xBC,0x5A,0xB1,0xBD,0x5B,0xB2,0xBD,0x5B,0xB3,0xBD,0x5B,0xB4,0xBE,0x5C,0xB5,0xBE,0x5B,0xB5,0xBE,0x5B,0xB7,0xBF,0x5C,0xB7,0xBF,0x5C,0xB8,0xBF,0x5C,0xB9,0xC0,0x5C,0xB9,0xC0,0x5C,0xBA,0xC0,0x5C,0xBA,0xC1,0x5D,0xBB,0xC2,0x5D,0xBC,0xC2,0x5D,0xBC,0xC2,0x5D,0xBD,0xC2,0x5E,0xBE,0xC3,0x5E,0xBE,0xC3,0x5E,0xBF,0xC3,0x5E,0xC0,0xC3,0x5E,0xC0,0xC4,0x5E,0xC1,0xC4,}; //200 Pixels diff --git a/src/Graphics.h b/src/Graphics.h index 5e43417e0..d3f891c0e 100644 --- a/src/Graphics.h +++ b/src/Graphics.h @@ -117,9 +117,7 @@ public: #ifdef OGLR //OpenGL specific instance variables GLuint vidBuf, textTexture; -#else - SDL_Surface * sdl_scrn; -#endif + #endif //Common graphics methods in Graphics.cpp static char * GenerateGradient(pixel * colours, float * points, int pointcount, int size); @@ -147,8 +145,7 @@ public: void draw_icon(int x, int y, Icon icon); void Clear(); - void AttachSDLSurface(SDL_Surface * surface); - void Blit(); + void Finalise(); // int drawtext(int x, int y, const char *s, int r, int g, int b, int a); int drawtext(int x, int y, std::string s, int r, int g, int b, int a); diff --git a/src/OpenGLGraphics.cpp b/src/OpenGLGraphics.cpp index 61c422cd7..b7d479559 100644 --- a/src/OpenGLGraphics.cpp +++ b/src/OpenGLGraphics.cpp @@ -6,7 +6,45 @@ Graphics::Graphics(): sdl_scale(1) { - + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + + //glOrtho(0, (XRES+BARSIZE)*sdl_scale, 0, (YRES+MENUSIZE)*sdl_scale, -1, 1); + glOrtho(0, (XRES+BARSIZE)*sdl_scale, (YRES+MENUSIZE)*sdl_scale, 0, -1, 1); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + + //glRasterPos2i(0, (YRES+MENUSIZE)); + glRasterPos2i(0, 0); + glPixelZoom(1, 1); + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + //Texture for main UI + glEnable(GL_TEXTURE_2D); + + glGenTextures(1, &vidBuf); + glBindTexture(GL_TEXTURE_2D, vidBuf); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, XRES+BARSIZE, YRES+MENUSIZE, 0, GL_BGRA, GL_UNSIGNED_BYTE, NULL); + + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); + + glBindTexture(GL_TEXTURE_2D, 0); + + glGenTextures(1, &textTexture); + glBindTexture(GL_TEXTURE_2D, textTexture); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + glBindTexture(GL_TEXTURE_2D, 0); + + glDisable(GL_TEXTURE_2D); } Graphics::~Graphics() @@ -19,72 +57,9 @@ void Graphics::Clear() glClear(GL_COLOR_BUFFER_BIT); } -void Graphics::AttachSDLSurface(SDL_Surface * surface) +void Graphics::Finalise() { - //sdl_scrn = surface; - SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - - //glOrtho(0, (XRES+BARSIZE)*sdl_scale, 0, (YRES+MENUSIZE)*sdl_scale, -1, 1); - glOrtho(0, (XRES+BARSIZE)*sdl_scale, (YRES+MENUSIZE)*sdl_scale, 0, -1, 1); - - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - - - //glRasterPos2i(0, (YRES+MENUSIZE)); - glRasterPos2i(0, 0); - glPixelZoom(1, 1); - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - //Texture for main UI - glEnable(GL_TEXTURE_2D); - - glGenTextures(1, &vidBuf); - glBindTexture(GL_TEXTURE_2D, vidBuf); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, XRES+BARSIZE, YRES+MENUSIZE, 0, GL_BGRA, GL_UNSIGNED_BYTE, NULL); - - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); - - glBindTexture(GL_TEXTURE_2D, 0); - - glGenTextures(1, &textTexture); - glBindTexture(GL_TEXTURE_2D, textTexture); - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - - glBindTexture(GL_TEXTURE_2D, 0); - - glDisable(GL_TEXTURE_2D); -} - -void Graphics::Blit() -{ - //glDrawPixels(w,h,GL_BGRA,GL_UNSIGNED_BYTE,src); //Why does this still think it's ABGR? - /*glEnable( GL_TEXTURE_2D ); - glBindTexture(GL_TEXTURE_2D, vidBuf); - glColor4f(1.0f, 1.0f, 1.0f, 1.0f); - glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, XRES+BARSIZE, YRES+MENUSIZE, GL_BGRA, GL_UNSIGNED_BYTE, vid); - glBegin(GL_QUADS); - glTexCoord2d(1, 0); - glVertex3f((XRES+BARSIZE)*sdl_scale, (YRES+MENUSIZE)*sdl_scale, 1.0); - glTexCoord2d(0, 0); - glVertex3f(0, (YRES+MENUSIZE)*sdl_scale, 1.0); - glTexCoord2d(0, 1); - glVertex3f(0, 0, 1.0); - glTexCoord2d(1, 1); - glVertex3f((XRES+BARSIZE)*sdl_scale, 0, 1.0); - glEnd(); - - glDisable( GL_TEXTURE_2D );*/ glFlush(); - SDL_GL_SwapBuffers (); } int Graphics::drawtext(int x, int y, const char *s, int r, int g, int b, int a) diff --git a/src/PowderToy.cpp b/src/PowderToySDL.cpp similarity index 86% rename from src/PowderToy.cpp rename to src/PowderToySDL.cpp index 7e3b5346f..8ec1abdce 100644 --- a/src/PowderToy.cpp +++ b/src/PowderToySDL.cpp @@ -33,6 +33,38 @@ using namespace std; extern "C" IMAGE_DOS_HEADER __ImageBase; #endif +SDL_Surface * sdl_scrn; + +#ifdef OGLR +void blit() +{ + SDL_GL_SwapBuffers(); +} +#else +void blit(pixel * vid) +{ + if(sdl_scrn) + { + pixel * dst; + pixel * src = vid; + int j, x = 0, y = 0, w = XRES+BARSIZE, h = YRES+MENUSIZE, pitch = XRES+BARSIZE; + if (SDL_MUSTLOCK(sdl_scrn)) + if (SDL_LockSurface(sdl_scrn)<0) + return; + dst=(pixel *)sdl_scrn->pixels+y*sdl_scrn->pitch/PIXELSIZE+x; + for (j=0; jpitch/PIXELSIZE; + src+=pitch; + } + if (SDL_MUSTLOCK(sdl_scrn)) + SDL_UnlockSurface(sdl_scrn); + SDL_UpdateRect(sdl_scrn,0,0,0,0); + } +#endif +} + SDL_Surface * SDLOpen() { SDL_Surface * surface; @@ -93,26 +125,18 @@ SDL_Surface * SDLOpen() return surface; } -/*int SDLPoll(SDL_Event * event) -{ - while (SDL_PollEvent(event)) - { - switch (event->type) - { - case SDL_QUIT: - return 1; - } - } - return 0; -}*/ - int main(int argc, char * argv[]) { int elapsedTime = 0, currentTime = 0, lastTime = 0, currentFrame = 0; float fps = 0, delta = 1.0f; + sdl_scrn = SDLOpen(); +#ifdef OGLR + SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1); +#endif + ui::Engine::Ref().g = new Graphics(); - ui::Engine::Ref().g->AttachSDLSurface(SDLOpen()); + //ui::Engine::Ref().g->AttachSDLSurface(SDLOpen()); ui::Engine * engine = &ui::Engine::Ref(); engine->Begin(XRES+BARSIZE, YRES+MENUSIZE); @@ -166,6 +190,12 @@ int main(int argc, char * argv[]) engine->Tick(); engine->Draw(); + +#ifdef OGLR + blit(); +#else + blit(engine->g->vid); +#endif currentFrame++; currentTime = SDL_GetTicks(); diff --git a/src/RasterGraphics.cpp b/src/RasterGraphics.cpp index 563aef206..b807238f2 100644 --- a/src/RasterGraphics.cpp +++ b/src/RasterGraphics.cpp @@ -20,32 +20,9 @@ void Graphics::Clear() memset(vid, 0, PIXELSIZE * ((XRES+BARSIZE) * (YRES+MENUSIZE))); } -void Graphics::AttachSDLSurface(SDL_Surface * surface) +void Graphics::Finalise() { - sdl_scrn = surface; -} -void Graphics::Blit() -{ - if(sdl_scrn) - { - pixel * dst; - pixel * src = vid; - int j, x = 0, y = 0, w = XRES+BARSIZE, h = YRES+MENUSIZE, pitch = XRES+BARSIZE; - if (SDL_MUSTLOCK(sdl_scrn)) - if (SDL_LockSurface(sdl_scrn)<0) - return; - dst=(pixel *)sdl_scrn->pixels+y*sdl_scrn->pitch/PIXELSIZE+x; - for (j=0; jpitch/PIXELSIZE; - src+=pitch; - } - if (SDL_MUSTLOCK(sdl_scrn)) - SDL_UnlockSurface(sdl_scrn); - SDL_UpdateRect(sdl_scrn,0,0,0,0); - } } int Graphics::drawtext(int x, int y, const char *s, int r, int g, int b, int a) diff --git a/src/interface/Engine.cpp b/src/interface/Engine.cpp index aea89e7d3..130428433 100644 --- a/src/interface/Engine.cpp +++ b/src/interface/Engine.cpp @@ -184,7 +184,7 @@ void Engine::Draw() char fpsText[512]; sprintf(fpsText, "FPS: %.2f, Delta: %.3f", fps, dt); ui::Engine::Ref().g->drawtext(10, 10, fpsText, 255, 255, 255, 255); - g->Blit(); + g->Finalise(); } void Engine::SetFps(float fps)