added some graphics but only for debug

This commit is contained in:
peri4
2010-08-27 14:04:05 +04:00
parent b3854e867d
commit 95f3fb74fa
37 changed files with 876 additions and 707 deletions

Binary file not shown.

View File

@@ -10,10 +10,19 @@ SOURCES += main.cpp \
../loader.cpp \
alienmodel.cpp \
towermodel.cpp \
splashmodel.cpp
splashmodel.cpp \
../map.cpp \
../game_data.cpp
HEADERS += mainwindow.h \
../loader.h \
alienmodel.h \
towermodel.h \
splashmodel.h
splashmodel.h \
../base_types.h \
../map.h \
../game_data.h
FORMS += mainwindow.ui
TRANSLATIONS += adeditor_ru.ts
RESOURCES += \
ADeditor.qrc

View File

@@ -1,254 +1,104 @@
<!DOCTYPE QtCreatorProject>
<qtcreator>
<data>
<variable>RunConfiguration0-BaseEnvironmentBase</variable>
<value type="int">2</value>
</data>
<data>
<variable>RunConfiguration0-CommandLineArguments</variable>
<valuelist type="QVariantList"/>
</data>
<data>
<variable>RunConfiguration0-ProFile</variable>
<value type="QString">ADeditor.pro</value>
</data>
<data>
<variable>RunConfiguration0-RunConfiguration.name</variable>
<value type="QString">ADeditor</value>
</data>
<data>
<variable>RunConfiguration0-UseDyldImageSuffix</variable>
<value type="bool">false</value>
</data>
<data>
<variable>RunConfiguration0-UseTerminal</variable>
<value type="bool">false</value>
</data>
<data>
<variable>RunConfiguration0-UserEnvironmentChanges</variable>
<valuelist type="QVariantList"/>
</data>
<data>
<variable>RunConfiguration0-UserSetName</variable>
<value type="bool">false</value>
</data>
<data>
<variable>RunConfiguration0-UserSetWorkingDirectory</variable>
<value type="bool">false</value>
</data>
<data>
<variable>RunConfiguration0-UserWorkingDirectory</variable>
<value type="QString"></value>
</data>
<data>
<variable>RunConfiguration0-type</variable>
<value type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
</data>
<data>
<variable>activeRunConfiguration</variable>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>activebuildconfiguration</variable>
<value type="QString">Debug</value>
</data>
<data>
<variable>buildConfiguration-Debug</variable>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<value key="QtVersionId" type="int">2</value>
<value key="ToolChain" type="int">0</value>
<value key="buildConfiguration" type="int">2</value>
<value key="EditorConfiguration.Codec" type="QByteArray">System</value>
</valuemap>
</data>
<data>
<variable>buildconfiguration-Debug-buildstep0</variable>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList">
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5VyjD99lFj,guid=cf0067cbadce72e8c9c0f05e4c74f11a</value>
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value>
<value type="QString">DESKTOP_SESSION=gnome</value>
<value type="QString">DISPLAY=:0.0</value>
<value type="QString">GDMSESSION=gnome</value>
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value>
<value type="QString">GDM_LANG=ru_RU.UTF-8</value>
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-sQCAQN</value>
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/home/andrey</value>
<value type="QString">LANG=ru_RU.UTF-8</value>
<value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
<value type="QString">LOGNAME=andrey</value>
<value type="QString">MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path</value>
<value type="QString">ORBIT_SOCKETDIR=/tmp/orbit-andrey</value>
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
<value type="QString">PWD=/home/andrey</value>
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1112,unix/buull-eeePC:/tmp/.ICE-unix/1112</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SPEECHD_PORT=6561</value>
<value type="QString">SSH_AGENT_PID=1146</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-sQCAQN/ssh</value>
<value type="QString">USER=andrey</value>
<value type="QString">USERNAME=andrey</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-QG4tiG/database</value>
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1282732313.174012-433654821</value>
</valuelist>
<valuelist key="abstractProcess.arguments" type="QVariantList">
<value type="QString">/home/andrey/AD/aliendefender/ADeditor/ADeditor.pro</value>
<value type="QString">-spec</value>
<value type="QString">linux-g++</value>
<value type="QString">-r</value>
<value type="QString">CONFIG+=debug</value>
</valuelist>
<value key="abstractProcess.command" type="QString">/usr/bin/qmake-qt4</value>
<value key="abstractProcess.enabled" type="bool">false</value>
<value key="abstractProcess.workingDirectory" type="QString">/home/andrey/AD/aliendefender/ADeditor</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Настольный компьютер</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.DesktopTarget</value>
<value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">0</value>
<value key="ProjectExplorer.Target.ActiveDeployConfiguration" type="int">0</value>
<value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
<valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
<valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
</valuemap>
<valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Build</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
<value type="QString">clean</value>
</valuelist>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Clean</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
<value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
<valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Debug</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/peri4/pprojects/aliendefender/ADeditor</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
</valuemap>
<value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">1</value>
<valuemap key="ProjectExplorer.Target.DeployConfiguration.0" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
<value key="ProjectExplorer.BuildStepList.StepsCount" type="int">0</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Deploy</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">1</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">No deployment</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value key="ProjectExplorer.Target.DeployConfigurationCount" type="int">1</value>
<valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">ADeditor</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">ADeditor.pro</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
</valuemap>
</data>
<data>
<variable>buildconfiguration-Debug-buildstep1</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList">
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5VyjD99lFj,guid=cf0067cbadce72e8c9c0f05e4c74f11a</value>
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value>
<value type="QString">DESKTOP_SESSION=gnome</value>
<value type="QString">DISPLAY=:0.0</value>
<value type="QString">GDMSESSION=gnome</value>
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value>
<value type="QString">GDM_LANG=ru_RU.UTF-8</value>
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-sQCAQN</value>
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/home/andrey</value>
<value type="QString">LANG=ru_RU.UTF-8</value>
<value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
<value type="QString">LOGNAME=andrey</value>
<value type="QString">MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path</value>
<value type="QString">ORBIT_SOCKETDIR=/tmp/orbit-andrey</value>
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
<value type="QString">PWD=/home/andrey</value>
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1112,unix/buull-eeePC:/tmp/.ICE-unix/1112</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SPEECHD_PORT=6561</value>
<value type="QString">SSH_AGENT_PID=1146</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-sQCAQN/ssh</value>
<value type="QString">USER=andrey</value>
<value type="QString">USERNAME=andrey</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-QG4tiG/database</value>
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1282732313.174012-433654821</value>
</valuelist>
<value key="abstractProcess.IgnoreReturnValue" type="bool">false</value>
<valuelist key="abstractProcess.arguments" type="QVariantList">
<value type="QString">-w</value>
</valuelist>
<value key="abstractProcess.command" type="QString">/usr/bin/make</value>
<value key="abstractProcess.enabled" type="bool">true</value>
<value key="abstractProcess.workingDirectory" type="QString">/home/andrey/AD/aliendefender/ADeditor</value>
</valuemap>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>buildconfiguration-Debug-cleanstep0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList">
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5VyjD99lFj,guid=cf0067cbadce72e8c9c0f05e4c74f11a</value>
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value>
<value type="QString">DESKTOP_SESSION=gnome</value>
<value type="QString">DISPLAY=:0.0</value>
<value type="QString">GDMSESSION=gnome</value>
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value>
<value type="QString">GDM_LANG=ru_RU.UTF-8</value>
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-sQCAQN</value>
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/home/andrey</value>
<value type="QString">LANG=ru_RU.UTF-8</value>
<value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
<value type="QString">LOGNAME=andrey</value>
<value type="QString">MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path</value>
<value type="QString">ORBIT_SOCKETDIR=/tmp/orbit-andrey</value>
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
<value type="QString">PWD=/home/andrey</value>
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1112,unix/buull-eeePC:/tmp/.ICE-unix/1112</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SPEECHD_PORT=6561</value>
<value type="QString">SSH_AGENT_PID=1146</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-sQCAQN/ssh</value>
<value type="QString">USER=andrey</value>
<value type="QString">USERNAME=andrey</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-QG4tiG/database</value>
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1282732313.174012-433654821</value>
</valuelist>
<value key="abstractProcess.IgnoreReturnValue" type="bool">true</value>
<valuelist key="abstractProcess.arguments" type="QVariantList">
<value type="QString">clean</value>
<value type="QString">-w</value>
</valuelist>
<value key="abstractProcess.command" type="QString">/usr/bin/make</value>
<value key="abstractProcess.enabled" type="bool">true</value>
<value key="abstractProcess.workingDirectory" type="QString">/home/andrey/AD/aliendefender/ADeditor</value>
<value key="cleanConfig" type="bool">true</value>
<valuelist key="makeargs" type="QVariantList">
<value type="QString">clean</value>
</valuelist>
</valuemap>
<variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
<value type="QString">{4d5b06df-4184-42d4-9dfd-5c7caaa07ab2}</value>
</data>
<data>
<variable>buildconfigurations</variable>
<valuelist type="QVariantList">
<value type="QString">Debug</value>
</valuelist>
</data>
<data>
<variable>buildstep0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
<value key="mkspec" type="QString"></value>
</valuemap>
</data>
<data>
<variable>buildstep1</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
</valuemap>
</data>
<data>
<variable>buildsteps</variable>
<valuelist type="QVariantList">
<value type="QString">trolltech.qt4projectmanager.qmake</value>
<value type="QString">trolltech.qt4projectmanager.make</value>
</valuelist>
</data>
<data>
<variable>cleanstep0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
<value key="clean" type="bool">true</value>
</valuemap>
</data>
<data>
<variable>cleansteps</variable>
<valuelist type="QVariantList">
<value type="QString">trolltech.qt4projectmanager.make</value>
</valuelist>
</data>
<data>
<variable>defaultFileEncoding</variable>
<value type="QByteArray">System</value>
</data>
<data>
<variable>project</variable>
<valuemap type="QVariantMap"/>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">8</value>
</data>
</qtcreator>

View File

@@ -56,27 +56,17 @@
<variable>buildConfiguration-Debug</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<value key="QtVersionId" type="int">0</value>
<value key="QtVersionId" type="int">2</value>
<value key="ToolChain" type="int">0</value>
<value key="addQDumper" type=""></value>
<value key="buildConfiguration" type="int">2</value>
</valuemap>
</data>
<data>
<variable>buildConfiguration-Release</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
<value key="QtVersionId" type="int">0</value>
<value key="addQDumper" type=""></value>
<value key="buildConfiguration" type="int">0</value>
</valuemap>
</data>
<data>
<variable>buildconfiguration-Debug-buildstep0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList">
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5i8Go7nPio,guid=870ffe971971ceac89206f0e4c5facbd</value>
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5VyjD99lFj,guid=cf0067cbadce72e8c9c0f05e4c74f11a</value>
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value>
<value type="QString">DESKTOP_SESSION=gnome</value>
<value type="QString">DISPLAY=:0.0</value>
@@ -84,7 +74,7 @@
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value>
<value type="QString">GDM_LANG=ru_RU.UTF-8</value>
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-7vXnOW</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-sQCAQN</value>
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/home/andrey</value>
<value type="QString">LANG=ru_RU.UTF-8</value>
@@ -95,17 +85,17 @@
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
<value type="QString">PWD=/home/andrey</value>
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1124,unix/buull-eeePC:/tmp/.ICE-unix/1124</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1112,unix/buull-eeePC:/tmp/.ICE-unix/1112</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SPEECHD_PORT=6561</value>
<value type="QString">SSH_AGENT_PID=1158</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-7vXnOW/ssh</value>
<value type="QString">SSH_AGENT_PID=1146</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-sQCAQN/ssh</value>
<value type="QString">USER=andrey</value>
<value type="QString">USERNAME=andrey</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-HWCXAG/database</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-QG4tiG/database</value>
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1281338556.676663-803309736</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1282732313.174012-433654821</value>
</valuelist>
<valuelist key="abstractProcess.arguments" type="QVariantList">
<value type="QString">/home/andrey/AD/aliendefender/ADeditor/ADeditor.pro</value>
@@ -124,7 +114,7 @@
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList">
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5i8Go7nPio,guid=870ffe971971ceac89206f0e4c5facbd</value>
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5VyjD99lFj,guid=cf0067cbadce72e8c9c0f05e4c74f11a</value>
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value>
<value type="QString">DESKTOP_SESSION=gnome</value>
<value type="QString">DISPLAY=:0.0</value>
@@ -132,7 +122,7 @@
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value>
<value type="QString">GDM_LANG=ru_RU.UTF-8</value>
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-7vXnOW</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-sQCAQN</value>
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/home/andrey</value>
<value type="QString">LANG=ru_RU.UTF-8</value>
@@ -143,17 +133,17 @@
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
<value type="QString">PWD=/home/andrey</value>
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1124,unix/buull-eeePC:/tmp/.ICE-unix/1124</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1112,unix/buull-eeePC:/tmp/.ICE-unix/1112</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SPEECHD_PORT=6561</value>
<value type="QString">SSH_AGENT_PID=1158</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-7vXnOW/ssh</value>
<value type="QString">SSH_AGENT_PID=1146</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-sQCAQN/ssh</value>
<value type="QString">USER=andrey</value>
<value type="QString">USERNAME=andrey</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-HWCXAG/database</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-QG4tiG/database</value>
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1281338556.676663-803309736</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1282732313.174012-433654821</value>
</valuelist>
<value key="abstractProcess.IgnoreReturnValue" type="bool">false</value>
<valuelist key="abstractProcess.arguments" type="QVariantList">
@@ -169,7 +159,7 @@
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList">
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5i8Go7nPio,guid=870ffe971971ceac89206f0e4c5facbd</value>
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5VyjD99lFj,guid=cf0067cbadce72e8c9c0f05e4c74f11a</value>
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value>
<value type="QString">DESKTOP_SESSION=gnome</value>
<value type="QString">DISPLAY=:0.0</value>
@@ -177,7 +167,7 @@
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value>
<value type="QString">GDM_LANG=ru_RU.UTF-8</value>
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-7vXnOW</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-sQCAQN</value>
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/home/andrey</value>
<value type="QString">LANG=ru_RU.UTF-8</value>
@@ -188,17 +178,17 @@
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
<value type="QString">PWD=/home/andrey</value>
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1124,unix/buull-eeePC:/tmp/.ICE-unix/1124</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1112,unix/buull-eeePC:/tmp/.ICE-unix/1112</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SPEECHD_PORT=6561</value>
<value type="QString">SSH_AGENT_PID=1158</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-7vXnOW/ssh</value>
<value type="QString">SSH_AGENT_PID=1146</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-sQCAQN/ssh</value>
<value type="QString">USER=andrey</value>
<value type="QString">USERNAME=andrey</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-HWCXAG/database</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-QG4tiG/database</value>
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1281338556.676663-803309736</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1282732313.174012-433654821</value>
</valuelist>
<value key="abstractProcess.IgnoreReturnValue" type="bool">true</value>
<valuelist key="abstractProcess.arguments" type="QVariantList">
@@ -214,29 +204,10 @@
</valuelist>
</valuemap>
</data>
<data>
<variable>buildconfiguration-Release-buildstep0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
</valuemap>
</data>
<data>
<variable>buildconfiguration-Release-buildstep1</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
</valuemap>
</data>
<data>
<variable>buildconfiguration-Release-cleanstep0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
</valuemap>
</data>
<data>
<variable>buildconfigurations</variable>
<valuelist type="QVariantList">
<value type="QString">Debug</value>
<value type="QString">Release</value>
</valuelist>
</data>
<data>

5
ADeditor/ADeditor.qrc Normal file
View File

@@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/translates">
<file>adeditor_ru.qm</file>
</qresource>
</RCC>

View File

@@ -1,9 +1,9 @@
#############################################################################
# Makefile for building: ADeditor
# Generated by qmake (2.01a) (Qt 4.6.2) on: ?? ???. 25 23:57:34 2010
# Generated by qmake (2.01a) (Qt 4.7.0) on: ?? ???. 26 18:09:05 2010
# Project: ADeditor.pro
# Template: app
# Command: /usr/bin/qmake-qt4 -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile ADeditor.pro
# Command: /usr/bin/qmake -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug QMLINSPECTOR_PATH=/usr/share/qtcreator/qmljsdebugger -o Makefile ADeditor.pro
#############################################################################
####### Compiler, tools and options
@@ -11,15 +11,15 @@
CC = gcc
CXX = g++
DEFINES = -DQT_XMLPATTERNS_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
CFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES)
CXXFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES)
CFLAGS = -Wall -W -D_REENTRANT $(DEFINES)
CXXFLAGS = -Wall -W -D_REENTRANT $(DEFINES)
INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtXmlPatterns -I/usr/include/qt4 -I. -I.
LINK = g++
LFLAGS =
LIBS = $(SUBLIBS) -L/usr/lib -lQtXmlPatterns -lQtXml -lQtGui -lQtCore -lpthread
LFLAGS = -Wl,-rpath,/usr/lib/qt4
LIBS = $(SUBLIBS) -L/usr/lib/qt4 -lQtXmlPatterns -L/usr/lib/qt4 -lQtNetwork -lQtXml -lQtGui -L/usr/X11R6/lib -lQtCore -lgthread-2.0 -lrt -lglib-2.0 -lpthread
AR = ar cqs
RANLIB =
QMAKE = /usr/bin/qmake-qt4
QMAKE = /usr/bin/qmake
TAR = tar -cf
COMPRESS = gzip -9f
COPY = cp -f
@@ -48,26 +48,37 @@ SOURCES = main.cpp \
../loader.cpp \
alienmodel.cpp \
towermodel.cpp \
splashmodel.cpp moc_mainwindow.cpp \
splashmodel.cpp \
../map.cpp \
../game_data.cpp moc_mainwindow.cpp \
moc_loader.cpp \
moc_alienmodel.cpp \
moc_towermodel.cpp \
moc_splashmodel.cpp
moc_splashmodel.cpp \
moc_map.cpp \
moc_game_data.cpp \
qrc_ADeditor.cpp
OBJECTS = main.o \
mainwindow.o \
loader.o \
alienmodel.o \
towermodel.o \
splashmodel.o \
map.o \
game_data.o \
moc_mainwindow.o \
moc_loader.o \
moc_alienmodel.o \
moc_towermodel.o \
moc_splashmodel.o
moc_splashmodel.o \
moc_map.o \
moc_game_data.o \
qrc_ADeditor.o
DIST = /usr/share/qt4/mkspecs/common/g++.conf \
/usr/share/qt4/mkspecs/common/unix.conf \
/usr/share/qt4/mkspecs/common/linux.conf \
/usr/share/qt4/mkspecs/qconfig.pri \
/usr/share/qt4/mkspecs/modules/qt_webkit_version.pri \
/usr/share/qt4/mkspecs/features/qt_functions.prf \
/usr/share/qt4/mkspecs/features/qt_config.prf \
/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
@@ -119,6 +130,7 @@ Makefile: ADeditor.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/q
/usr/share/qt4/mkspecs/common/unix.conf \
/usr/share/qt4/mkspecs/common/linux.conf \
/usr/share/qt4/mkspecs/qconfig.pri \
/usr/share/qt4/mkspecs/modules/qt_webkit_version.pri \
/usr/share/qt4/mkspecs/features/qt_functions.prf \
/usr/share/qt4/mkspecs/features/qt_config.prf \
/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
@@ -134,15 +146,17 @@ Makefile: ADeditor.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/q
/usr/share/qt4/mkspecs/features/yacc.prf \
/usr/share/qt4/mkspecs/features/lex.prf \
/usr/share/qt4/mkspecs/features/include_source_dir.prf \
/usr/lib/libQtXmlPatterns.prl \
/usr/lib/libQtXml.prl \
/usr/lib/libQtGui.prl \
/usr/lib/libQtCore.prl
$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile ADeditor.pro
/usr/lib/qt4/libQtXmlPatterns.prl \
/usr/lib/qt4/libQtNetwork.prl \
/usr/lib/qt4/libQtCore.prl \
/usr/lib/qt4/libQtXml.prl \
/usr/lib/qt4/libQtGui.prl
$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug QMLINSPECTOR_PATH=/usr/share/qtcreator/qmljsdebugger -o Makefile ADeditor.pro
/usr/share/qt4/mkspecs/common/g++.conf:
/usr/share/qt4/mkspecs/common/unix.conf:
/usr/share/qt4/mkspecs/common/linux.conf:
/usr/share/qt4/mkspecs/qconfig.pri:
/usr/share/qt4/mkspecs/modules/qt_webkit_version.pri:
/usr/share/qt4/mkspecs/features/qt_functions.prf:
/usr/share/qt4/mkspecs/features/qt_config.prf:
/usr/share/qt4/mkspecs/features/exclusive_builds.prf:
@@ -158,16 +172,17 @@ Makefile: ADeditor.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/q
/usr/share/qt4/mkspecs/features/yacc.prf:
/usr/share/qt4/mkspecs/features/lex.prf:
/usr/share/qt4/mkspecs/features/include_source_dir.prf:
/usr/lib/libQtXmlPatterns.prl:
/usr/lib/libQtXml.prl:
/usr/lib/libQtGui.prl:
/usr/lib/libQtCore.prl:
/usr/lib/qt4/libQtXmlPatterns.prl:
/usr/lib/qt4/libQtNetwork.prl:
/usr/lib/qt4/libQtCore.prl:
/usr/lib/qt4/libQtXml.prl:
/usr/lib/qt4/libQtGui.prl:
qmake: FORCE
@$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile ADeditor.pro
@$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug QMLINSPECTOR_PATH=/usr/share/qtcreator/qmljsdebugger -o Makefile ADeditor.pro
dist:
@$(CHK_DIR_EXISTS) .tmp/ADeditor1.0.0 || $(MKDIR) .tmp/ADeditor1.0.0
$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/ADeditor1.0.0/ && $(COPY_FILE) --parents mainwindow.h ../loader.h alienmodel.h towermodel.h splashmodel.h .tmp/ADeditor1.0.0/ && $(COPY_FILE) --parents main.cpp mainwindow.cpp ../loader.cpp alienmodel.cpp towermodel.cpp splashmodel.cpp .tmp/ADeditor1.0.0/ && $(COPY_FILE) --parents mainwindow.ui .tmp/ADeditor1.0.0/ && (cd `dirname .tmp/ADeditor1.0.0` && $(TAR) ADeditor1.0.0.tar ADeditor1.0.0 && $(COMPRESS) ADeditor1.0.0.tar) && $(MOVE) `dirname .tmp/ADeditor1.0.0`/ADeditor1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/ADeditor1.0.0
$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/ADeditor1.0.0/ && $(COPY_FILE) --parents mainwindow.h ../loader.h alienmodel.h towermodel.h splashmodel.h ../base_types.h ../map.h ../game_data.h .tmp/ADeditor1.0.0/ && $(COPY_FILE) --parents ADeditor.qrc .tmp/ADeditor1.0.0/ && $(COPY_FILE) --parents main.cpp mainwindow.cpp ../loader.cpp alienmodel.cpp towermodel.cpp splashmodel.cpp ../map.cpp ../game_data.cpp .tmp/ADeditor1.0.0/ && $(COPY_FILE) --parents mainwindow.ui .tmp/ADeditor1.0.0/ && $(COPY_FILE) --parents adeditor_ru.ts .tmp/ADeditor1.0.0/ && (cd `dirname .tmp/ADeditor1.0.0` && $(TAR) ADeditor1.0.0.tar ADeditor1.0.0 && $(COMPRESS) ADeditor1.0.0.tar) && $(MOVE) `dirname .tmp/ADeditor1.0.0`/ADeditor1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/ADeditor1.0.0
clean:compiler_clean
@@ -182,13 +197,15 @@ distclean: clean
-$(DEL_FILE) Makefile
check: first
mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
compiler_moc_header_make_all: moc_mainwindow.cpp moc_loader.cpp moc_alienmodel.cpp moc_towermodel.cpp moc_splashmodel.cpp
compiler_moc_header_make_all: moc_mainwindow.cpp moc_loader.cpp moc_alienmodel.cpp moc_towermodel.cpp moc_splashmodel.cpp moc_map.cpp moc_game_data.cpp
compiler_moc_header_clean:
-$(DEL_FILE) moc_mainwindow.cpp moc_loader.cpp moc_alienmodel.cpp moc_towermodel.cpp moc_splashmodel.cpp
-$(DEL_FILE) moc_mainwindow.cpp moc_loader.cpp moc_alienmodel.cpp moc_towermodel.cpp moc_splashmodel.cpp moc_map.cpp moc_game_data.cpp
moc_mainwindow.cpp: alienmodel.h \
../loader.h \
../game_data.h \
@@ -198,14 +215,14 @@ moc_mainwindow.cpp: alienmodel.h \
towermodel.h \
splashmodel.h \
mainwindow.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) mainwindow.h -o moc_mainwindow.cpp
/usr/bin/moc $(DEFINES) $(INCPATH) mainwindow.h -o moc_mainwindow.cpp
moc_loader.cpp: ../game_data.h \
../player.h \
../base_types.h \
../map.h \
../loader.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) ../loader.h -o moc_loader.cpp
/usr/bin/moc $(DEFINES) $(INCPATH) ../loader.h -o moc_loader.cpp
moc_alienmodel.cpp: ../loader.h \
../game_data.h \
@@ -213,7 +230,7 @@ moc_alienmodel.cpp: ../loader.h \
../base_types.h \
../map.h \
alienmodel.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) alienmodel.h -o moc_alienmodel.cpp
/usr/bin/moc $(DEFINES) $(INCPATH) alienmodel.h -o moc_alienmodel.cpp
moc_towermodel.cpp: ../loader.h \
../game_data.h \
@@ -221,7 +238,7 @@ moc_towermodel.cpp: ../loader.h \
../base_types.h \
../map.h \
towermodel.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) towermodel.h -o moc_towermodel.cpp
/usr/bin/moc $(DEFINES) $(INCPATH) towermodel.h -o moc_towermodel.cpp
moc_splashmodel.cpp: ../loader.h \
../game_data.h \
@@ -229,10 +246,25 @@ moc_splashmodel.cpp: ../loader.h \
../base_types.h \
../map.h \
splashmodel.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) splashmodel.h -o moc_splashmodel.cpp
/usr/bin/moc $(DEFINES) $(INCPATH) splashmodel.h -o moc_splashmodel.cpp
compiler_rcc_make_all:
moc_map.cpp: ../base_types.h \
../map.h
/usr/bin/moc $(DEFINES) $(INCPATH) ../map.h -o moc_map.cpp
moc_game_data.cpp: ../player.h \
../base_types.h \
../map.h \
../game_data.h
/usr/bin/moc $(DEFINES) $(INCPATH) ../game_data.h -o moc_game_data.cpp
compiler_rcc_make_all: qrc_ADeditor.cpp
compiler_rcc_clean:
-$(DEL_FILE) qrc_ADeditor.cpp
qrc_ADeditor.cpp: ADeditor.qrc \
adeditor_ru.qm
/usr/bin/rcc -name ADeditor ADeditor.qrc -o qrc_ADeditor.cpp
compiler_image_collection_make_all: qmake_image_collection.cpp
compiler_image_collection_clean:
-$(DEL_FILE) qmake_image_collection.cpp
@@ -242,7 +274,7 @@ compiler_uic_make_all: ui_mainwindow.h
compiler_uic_clean:
-$(DEL_FILE) ui_mainwindow.h
ui_mainwindow.h: mainwindow.ui
/usr/bin/uic-qt4 mainwindow.ui -o ui_mainwindow.h
/usr/bin/uic mainwindow.ui -o ui_mainwindow.h
compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
@@ -250,7 +282,7 @@ compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_moc_header_clean compiler_uic_clean
compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean
####### Compile
@@ -308,6 +340,16 @@ splashmodel.o: splashmodel.cpp splashmodel.h \
../map.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o splashmodel.o splashmodel.cpp
map.o: ../map.cpp ../map.h \
../base_types.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o map.o ../map.cpp
game_data.o: ../game_data.cpp ../game_data.h \
../player.h \
../base_types.h \
../map.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o game_data.o ../game_data.cpp
moc_mainwindow.o: moc_mainwindow.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwindow.o moc_mainwindow.cpp
@@ -323,6 +365,15 @@ moc_towermodel.o: moc_towermodel.cpp
moc_splashmodel.o: moc_splashmodel.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_splashmodel.o moc_splashmodel.cpp
moc_map.o: moc_map.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_map.o moc_map.cpp
moc_game_data.o: moc_game_data.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_game_data.o moc_game_data.cpp
qrc_ADeditor.o: qrc_ADeditor.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_ADeditor.o qrc_ADeditor.cpp
####### Install
install: FORCE

View File

@@ -15,22 +15,22 @@
<wave prise="220" timeout="20000" id="3"/>
</waves>
<levels>
<level map="1" id="1" score="138978384" name="First Level"/>
<level map="1" id="1" score="149859760" name="First Level"/>
</levels>
<waveParts>
<wavePart alien="10" count="10" wave="1"/>
<wavePart alien="12" count="5" wave="1"/>
<wavePart alien="10" count="4" wave="1"/>
<wavePart alien="12" count="5" wave="1"/>
<wavePart alien="10" count="10" wave="1"/>
<wavePart alien="10" count="9" wave="2"/>
<wavePart alien="12" count="4" wave="3"/>
<wavePart alien="12" count="3" wave="3"/>
<wavePart alien="10" count="2" wave="3"/>
<wavePart alien="10" count="1" wave="3"/>
<wavePart alien="10" count="2" wave="3"/>
<wavePart alien="12" count="3" wave="3"/>
<wavePart alien="12" count="4" wave="3"/>
</waveParts>
<wavesOnLevels>
<waveOnLevel wave="3" level="1"/>
<waveOnLevel wave="2" level="1"/>
<waveOnLevel wave="1" level="1"/>
<waveOnLevel wave="2" level="1"/>
<waveOnLevel wave="3" level="1"/>
</wavesOnLevels>
<splashes>
<splash speed="0.2" imageType="1" lifetime="9999" id="1" name="rocket"/>
@@ -50,15 +50,15 @@
<trigger childAim="noAim" count="1" type="onTimer" id="4" name="smoke"/>
</triggers>
<chains>
<chain tower="1" trigger="4" child="5" parent="1"/>
<chain tower="1" trigger="3" child="4" parent="1"/>
<chain tower="1" trigger="4" child="5" parent="1"/>
<chain tower="2" trigger="2" parent="3"/>
<chain tower="3" trigger="4" child="5" parent="2"/>
<chain tower="3" trigger="3" child="4" parent="2"/>
<chain tower="3" trigger="4" child="5" parent="2"/>
</chains>
<towersOnLevels>
<towerOnLevel tower="3" level="1"/>
<towerOnLevel tower="2" level="1"/>
<towerOnLevel tower="1" level="1"/>
<towerOnLevel tower="2" level="1"/>
<towerOnLevel tower="3" level="1"/>
</towersOnLevels>
</ADdata>

View File

@@ -1,10 +1,14 @@
#include <QtGui/QApplication>
#include <QTranslator>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
QTranslator translator;
translator.load(":/translates/" + QString("adeditor_") + QLocale::system().name());
a.installTranslator(&translator);
MainWindow w;
w.show();
return a.exec();
}

View File

@@ -10,9 +10,6 @@
<height>489</height>
</rect>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
@@ -21,16 +18,28 @@
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QGridLayout" name="gridLayout_2">
<property name="margin">
<number>2</number>
</property>
<property name="spacing">
<number>2</number>
</property>
<item row="3" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>2</number>
</property>
<widget class="QWidget" name="tabAliens">
<attribute name="title">
<string>Aliens</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4" columnstretch="1,2">
<property name="margin">
<number>2</number>
</property>
<property name="spacing">
<number>2</number>
</property>
<item row="0" column="0">
<widget class="QListView" name="lvAliens">
<property name="editTriggers">
@@ -47,6 +56,12 @@
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>2</number>
</property>
<property name="margin">
<number>2</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
@@ -222,7 +237,7 @@
</sizepolicy>
</property>
<property name="text">
<string>Prise</string>
<string>Prize</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -276,7 +291,7 @@
<item>
<widget class="QCheckBox" name="cbAlIsFly">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -289,23 +304,10 @@
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9" stretch="10,4,0,1">
<layout class="QHBoxLayout" name="horizontalLayout_9" stretch="10,0,0">
<item>
<widget class="QLabel" name="label_8">
<property name="sizePolicy">
@@ -322,35 +324,6 @@
</property>
</widget>
</item>
<item>
<widget class="QGraphicsView" name="graphicsView">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>40</width>
<height>40</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_3">
<property name="enabled">
@@ -373,6 +346,19 @@
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
@@ -391,9 +377,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string>Add</string>
</property>
@@ -426,9 +409,6 @@
</item>
<item row="0" column="1" rowspan="2">
<widget class="QFrame" name="frame_2">
<property name="cursor">
<cursorShape>ArrowCursor</cursorShape>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
@@ -782,9 +762,6 @@
<height>32</height>
</size>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string>...</string>
</property>
@@ -808,9 +785,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string>Add</string>
</property>
@@ -824,9 +798,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string>Delete</string>
</property>
@@ -859,9 +830,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
@@ -986,9 +954,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="cursor">
<cursorShape>ArrowCursor</cursorShape>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
@@ -1076,9 +1041,6 @@
<height>32</height>
</size>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string>...</string>
</property>
@@ -1102,9 +1064,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string>Add</string>
</property>
@@ -1118,9 +1077,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string>Delete</string>
</property>
@@ -1139,9 +1095,6 @@
</item>
<item row="5" column="0">
<widget class="QPushButton" name="pbSave">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string>Save</string>
</property>

136
Makefile
View File

@@ -1,9 +1,9 @@
#############################################################################
# Makefile for building: aliendefender
# Generated by qmake (2.01a) (Qt 4.6.2) on: ?? ???. 23 12:02:15 2010
# Generated by qmake (2.01a) (Qt 4.7.0) on: ?? ???. 27 13:32:05 2010
# Project: aliendefender.pro
# Template: app
# Command: /usr/bin/qmake-qt4 -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile aliendefender.pro
# Command: /usr/bin/qmake -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug QMLINSPECTOR_PATH=/usr/share/qtcreator/qmljsdebugger QMLINSPECTOR_PATH=/usr/share/qtcreator/qmljsdebugger -o Makefile aliendefender.pro
#############################################################################
####### Compiler, tools and options
@@ -11,15 +11,15 @@
CC = gcc
CXX = g++
DEFINES = -DQT_XMLPATTERNS_LIB -DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
CFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES)
CXXFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES)
CFLAGS = -Wall -W -D_REENTRANT $(DEFINES)
CXXFLAGS = -Wall -W -D_REENTRANT $(DEFINES)
INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtXmlPatterns -I/usr/include/qt4 -I/usr/X11R6/include -I.
LINK = g++
LFLAGS =
LIBS = $(SUBLIBS) -L/usr/lib -L/usr/X11R6/lib -lQtXmlPatterns -lQtXml -lQtOpenGL -lQtGui -lQtNetwork -lQtCore -lGLU -lGL -lpthread
LFLAGS = -Wl,-rpath,/usr/lib/qt4
LIBS = $(SUBLIBS) -L/usr/lib/qt4 -L/usr/X11R6/lib -lQtXmlPatterns -L/usr/lib/qt4 -lQtXml -lQtOpenGL -L/usr/X11R6/lib -lQtGui -lQtNetwork -lQtCore -lgthread-2.0 -lrt -lglib-2.0 -lGLU -lGL -lpthread
AR = ar cqs
RANLIB =
QMAKE = /usr/bin/qmake-qt4
QMAKE = /usr/bin/qmake
TAR = tar -cf
COMPRESS = gzip -9f
COPY = cp -f
@@ -51,7 +51,9 @@ SOURCES = map.cpp \
splashes.cpp \
adcore.cpp \
player.cpp \
loader.cpp moc_map.cpp \
loader.cpp \
animation.cpp \
ad_graphics.cpp moc_map.cpp \
moc_game_data.cpp \
moc_aliens.cpp \
moc_towers.cpp \
@@ -59,6 +61,7 @@ SOURCES = map.cpp \
moc_adcore.cpp \
moc_player.cpp \
moc_loader.cpp \
moc_ad_graphics.cpp \
qrc_images.cpp
OBJECTS = map.o \
game_data.o \
@@ -69,6 +72,8 @@ OBJECTS = map.o \
adcore.o \
player.o \
loader.o \
animation.o \
ad_graphics.o \
moc_map.o \
moc_game_data.o \
moc_aliens.o \
@@ -77,11 +82,13 @@ OBJECTS = map.o \
moc_adcore.o \
moc_player.o \
moc_loader.o \
moc_ad_graphics.o \
qrc_images.o
DIST = /usr/share/qt4/mkspecs/common/g++.conf \
/usr/share/qt4/mkspecs/common/unix.conf \
/usr/share/qt4/mkspecs/common/linux.conf \
/usr/share/qt4/mkspecs/qconfig.pri \
/usr/share/qt4/mkspecs/modules/qt_webkit_version.pri \
/usr/share/qt4/mkspecs/features/qt_functions.prf \
/usr/share/qt4/mkspecs/features/qt_config.prf \
/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
@@ -134,6 +141,7 @@ Makefile: aliendefender.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/sh
/usr/share/qt4/mkspecs/common/unix.conf \
/usr/share/qt4/mkspecs/common/linux.conf \
/usr/share/qt4/mkspecs/qconfig.pri \
/usr/share/qt4/mkspecs/modules/qt_webkit_version.pri \
/usr/share/qt4/mkspecs/features/qt_functions.prf \
/usr/share/qt4/mkspecs/features/qt_config.prf \
/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
@@ -150,17 +158,18 @@ Makefile: aliendefender.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/sh
/usr/share/qt4/mkspecs/features/yacc.prf \
/usr/share/qt4/mkspecs/features/lex.prf \
/usr/share/qt4/mkspecs/features/include_source_dir.prf \
/usr/lib/libQtXmlPatterns.prl \
/usr/lib/libQtXml.prl \
/usr/lib/libQtOpenGL.prl \
/usr/lib/libQtGui.prl \
/usr/lib/libQtNetwork.prl \
/usr/lib/libQtCore.prl
$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile aliendefender.pro
/usr/lib/qt4/libQtXmlPatterns.prl \
/usr/lib/qt4/libQtNetwork.prl \
/usr/lib/qt4/libQtCore.prl \
/usr/lib/qt4/libQtXml.prl \
/usr/lib/qt4/libQtOpenGL.prl \
/usr/lib/qt4/libQtGui.prl
$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug QMLINSPECTOR_PATH=/usr/share/qtcreator/qmljsdebugger QMLINSPECTOR_PATH=/usr/share/qtcreator/qmljsdebugger -o Makefile aliendefender.pro
/usr/share/qt4/mkspecs/common/g++.conf:
/usr/share/qt4/mkspecs/common/unix.conf:
/usr/share/qt4/mkspecs/common/linux.conf:
/usr/share/qt4/mkspecs/qconfig.pri:
/usr/share/qt4/mkspecs/modules/qt_webkit_version.pri:
/usr/share/qt4/mkspecs/features/qt_functions.prf:
/usr/share/qt4/mkspecs/features/qt_config.prf:
/usr/share/qt4/mkspecs/features/exclusive_builds.prf:
@@ -177,18 +186,18 @@ Makefile: aliendefender.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/sh
/usr/share/qt4/mkspecs/features/yacc.prf:
/usr/share/qt4/mkspecs/features/lex.prf:
/usr/share/qt4/mkspecs/features/include_source_dir.prf:
/usr/lib/libQtXmlPatterns.prl:
/usr/lib/libQtXml.prl:
/usr/lib/libQtOpenGL.prl:
/usr/lib/libQtGui.prl:
/usr/lib/libQtNetwork.prl:
/usr/lib/libQtCore.prl:
/usr/lib/qt4/libQtXmlPatterns.prl:
/usr/lib/qt4/libQtNetwork.prl:
/usr/lib/qt4/libQtCore.prl:
/usr/lib/qt4/libQtXml.prl:
/usr/lib/qt4/libQtOpenGL.prl:
/usr/lib/qt4/libQtGui.prl:
qmake: FORCE
@$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile aliendefender.pro
@$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug QMLINSPECTOR_PATH=/usr/share/qtcreator/qmljsdebugger QMLINSPECTOR_PATH=/usr/share/qtcreator/qmljsdebugger -o Makefile aliendefender.pro
dist:
@$(CHK_DIR_EXISTS) .tmp/aliendefender1.0.0 || $(MKDIR) .tmp/aliendefender1.0.0
$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents base_types.h map.h game_data.h aliens.h towers.h splashes.h adcore.h player.h loader.h .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents images.qrc .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents map.cpp game_data.cpp aliens.cpp towers.cpp main.cpp splashes.cpp adcore.cpp player.cpp loader.cpp .tmp/aliendefender1.0.0/ && (cd `dirname .tmp/aliendefender1.0.0` && $(TAR) aliendefender1.0.0.tar aliendefender1.0.0 && $(COMPRESS) aliendefender1.0.0.tar) && $(MOVE) `dirname .tmp/aliendefender1.0.0`/aliendefender1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/aliendefender1.0.0
$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents base_types.h map.h game_data.h aliens.h towers.h splashes.h adcore.h player.h loader.h animation.h ad_graphics.h .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents images.qrc .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents map.cpp game_data.cpp aliens.cpp towers.cpp main.cpp splashes.cpp adcore.cpp player.cpp loader.cpp animation.cpp ad_graphics.cpp .tmp/aliendefender1.0.0/ && (cd `dirname .tmp/aliendefender1.0.0` && $(TAR) aliendefender1.0.0.tar aliendefender1.0.0 && $(COMPRESS) aliendefender1.0.0.tar) && $(MOVE) `dirname .tmp/aliendefender1.0.0`/aliendefender1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/aliendefender1.0.0
clean:compiler_clean
@@ -203,59 +212,80 @@ distclean: clean
-$(DEL_FILE) Makefile
check: first
mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
compiler_moc_header_make_all: moc_map.cpp moc_game_data.cpp moc_aliens.cpp moc_towers.cpp moc_splashes.cpp moc_adcore.cpp moc_player.cpp moc_loader.cpp
compiler_moc_header_make_all: moc_map.cpp moc_game_data.cpp moc_aliens.cpp moc_towers.cpp moc_splashes.cpp moc_adcore.cpp moc_player.cpp moc_loader.cpp moc_ad_graphics.cpp
compiler_moc_header_clean:
-$(DEL_FILE) moc_map.cpp moc_game_data.cpp moc_aliens.cpp moc_towers.cpp moc_splashes.cpp moc_adcore.cpp moc_player.cpp moc_loader.cpp
-$(DEL_FILE) moc_map.cpp moc_game_data.cpp moc_aliens.cpp moc_towers.cpp moc_splashes.cpp moc_adcore.cpp moc_player.cpp moc_loader.cpp moc_ad_graphics.cpp
moc_map.cpp: base_types.h \
map.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) map.h -o moc_map.cpp
/usr/bin/moc $(DEFINES) $(INCPATH) map.h -o moc_map.cpp
moc_game_data.cpp: player.h \
base_types.h \
map.h \
game_data.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) game_data.h -o moc_game_data.cpp
/usr/bin/moc $(DEFINES) $(INCPATH) game_data.h -o moc_game_data.cpp
moc_aliens.cpp: game_data.h \
player.h \
base_types.h \
map.h \
aliens.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) aliens.h -o moc_aliens.cpp
/usr/bin/moc $(DEFINES) $(INCPATH) aliens.h -o moc_aliens.cpp
moc_towers.cpp: game_data.h \
player.h \
base_types.h \
map.h \
towers.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) towers.h -o moc_towers.cpp
/usr/bin/moc $(DEFINES) $(INCPATH) towers.h -o moc_towers.cpp
moc_splashes.cpp: game_data.h \
player.h \
base_types.h \
map.h \
splashes.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) splashes.h -o moc_splashes.cpp
/usr/bin/moc $(DEFINES) $(INCPATH) splashes.h -o moc_splashes.cpp
moc_adcore.cpp: aliens.h \
game_data.h \
player.h \
base_types.h \
map.h \
towers.h \
splashes.h \
loader.h \
adcore.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) adcore.h -o moc_adcore.cpp
/usr/bin/moc $(DEFINES) $(INCPATH) adcore.h -o moc_adcore.cpp
moc_player.cpp: base_types.h \
player.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) player.h -o moc_player.cpp
/usr/bin/moc $(DEFINES) $(INCPATH) player.h -o moc_player.cpp
moc_loader.cpp: game_data.h \
player.h \
base_types.h \
map.h \
loader.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) loader.h -o moc_loader.cpp
/usr/bin/moc $(DEFINES) $(INCPATH) loader.h -o moc_loader.cpp
moc_ad_graphics.cpp: adcore.h \
aliens.h \
game_data.h \
player.h \
base_types.h \
map.h \
towers.h \
splashes.h \
loader.h \
animation.h \
ad_graphics.h
/usr/bin/moc $(DEFINES) $(INCPATH) ad_graphics.h -o moc_ad_graphics.cpp
compiler_rcc_make_all: qrc_images.cpp
compiler_rcc_clean:
@@ -306,19 +336,22 @@ map.o: map.cpp map.h \
game_data.o: game_data.cpp game_data.h \
player.h \
base_types.h
base_types.h \
map.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o game_data.o game_data.cpp
aliens.o: aliens.cpp aliens.h \
game_data.h \
player.h \
base_types.h
base_types.h \
map.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o aliens.o aliens.cpp
towers.o: towers.cpp towers.h \
game_data.h \
player.h \
base_types.h
base_types.h \
map.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o towers.o towers.cpp
main.o: main.cpp adcore.h \
@@ -326,15 +359,19 @@ main.o: main.cpp adcore.h \
game_data.h \
player.h \
base_types.h \
map.h \
towers.h \
splashes.h \
loader.h
loader.h \
ad_graphics.h \
animation.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
splashes.o: splashes.cpp splashes.h \
game_data.h \
player.h \
base_types.h
base_types.h \
map.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o splashes.o splashes.cpp
adcore.o: adcore.cpp adcore.h \
@@ -342,6 +379,7 @@ adcore.o: adcore.cpp adcore.h \
game_data.h \
player.h \
base_types.h \
map.h \
towers.h \
splashes.h \
loader.h
@@ -354,9 +392,26 @@ player.o: player.cpp player.h \
loader.o: loader.cpp loader.h \
game_data.h \
player.h \
base_types.h
base_types.h \
map.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o loader.o loader.cpp
animation.o: animation.cpp animation.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o animation.o animation.cpp
ad_graphics.o: ad_graphics.cpp ad_graphics.h \
adcore.h \
aliens.h \
game_data.h \
player.h \
base_types.h \
map.h \
towers.h \
splashes.h \
loader.h \
animation.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o ad_graphics.o ad_graphics.cpp
moc_map.o: moc_map.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_map.o moc_map.cpp
@@ -381,6 +436,9 @@ moc_player.o: moc_player.cpp
moc_loader.o: moc_loader.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_loader.o moc_loader.cpp
moc_ad_graphics.o: moc_ad_graphics.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_ad_graphics.o moc_ad_graphics.cpp
qrc_images.o: qrc_images.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_images.o qrc_images.cpp

106
ad_graphics.cpp Normal file
View File

@@ -0,0 +1,106 @@
#include "ad_graphics.h"
AD_Graphics::AD_Graphics(AD_Core *adcore, QWidget *parent) : QGraphicsView(parent)
{
loadImages();
data = adcore->addata;
core = adcore;
//scale(cellSize, cellSize);
setAlignment(Qt::AlignLeft | Qt::AlignTop);
scene = new QGraphicsScene();
setScene(scene);
setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
//gsw = new QGraphicsWidget();
//scene->addWidget(new QPushButton());
startTimer(25);
show();
}
AD_Graphics::~AD_Graphics()
{
//delete gsw;
delete scene;
}
void AD_Graphics::mouseDoubleClickEvent(QMouseEvent *)
{
core->nextWave();
}
void AD_Graphics::timerEvent(QTimerEvent * )
{
//qDebug() << data->curAliens.size();
draw();
}
void AD_Graphics::drawBackground(QPainter * p, const QRectF & )
{
for (int i=0; i<data->map->cells().size(); i++) {
for (int j=0; j<data->map->cells().at(i).size(); j++) {
QPen pen;
QBrush brush;
pen.setColor(Qt::white);
brush.setColor(Qt::white);
brush.setStyle(Qt::SolidPattern);
int cel = data->map->cells().at(i).at(j);
if (cel == Map::Wall) {
pen.setColor(Qt::black);
brush.setColor(Qt::black);
}
if (cel <= Map::PlayerTower && cel !=Map::Wall) {
pen.setColor(QColor(cel%255,(cel*100)%255,(cel+100)%255));
brush.setColor(QColor(cel%255,(cel*100)%255,(cel+100)%255));
}
// if (cel >= Map::PlayerAlien) {
// pen.setColor(Qt::yellow);
// brush.setColor(Qt::yellow);
// }
if (cel >= Map::Player) {
pen.setColor(QColor(cel%255,(cel*100)%255,(cel+100)%255,50));
brush.setColor(QColor(cel%255,(cel*100)%255,(cel+100)%255,50));
}
p->setPen(pen);
p->setBrush(brush);
p->drawRect(i*cellSize,j*cellSize,cellSize,cellSize);
}
}
for (QHash<int, AlienType>::iterator i = data->curAliens.begin(); i != data->curAliens.end(); ++i) {
//qDebug() << "draw alien";
//p->rotate(-90);
//p->scale(cellSize, cellSize);
//p->translate(rec.width()/2, rec.height()/2);
//p->rotate(-90);
//p->translate(-rec.height()/2, -rec.width()/2);
p->translate((*i).pos * cellSize+QPointF(10,10));
p->rotate((*i).angle);
p->drawImage(QRect(-20,-20,40,40), images[itAliens][0]->at(0));
p->resetTransform();
}
}
void AD_Graphics::draw()
{
scene->update();
//resetCachedContent();
//repaint();
}
void AD_Graphics::loadImages()
{
images.resize(3);
for (int i = 0; i < images.size(); i++) {
switch ((imagesType)i) {
case itAliens:
images[i].push_back(new Animation(":/images/images/Aliens/Al_00_"));
break;
default: break;
}
}
}

38
ad_graphics.h Normal file
View File

@@ -0,0 +1,38 @@
#ifndef AD_GRAPHICS_H
#define AD_GRAPHICS_H
#include <QGraphicsView>
#include <QGraphicsWidget>
#include <QPushButton>
#include <QMouseEvent>
#include "adcore.h"
#include "animation.h"
const float cellSize = 20.f;
class AD_Graphics: public QGraphicsView
{
Q_OBJECT
public:
explicit AD_Graphics(AD_Core * core, QWidget * parent = 0);
~AD_Graphics();
private:
enum imagesType {itAliens, itTowers, itSplashes};
void draw();
void drawBackground(QPainter * p, const QRectF &);
void loadImages();
void mouseDoubleClickEvent(QMouseEvent *);
QGraphicsScene * scene;
Game_Data * data;
AD_Core * core;
QVector<QVector<Animation * > > images;
//QGraphicsWidget * gsw;
protected:
void timerEvent(QTimerEvent * );
};
#endif // AD_GRAPHICS_H

View File

@@ -1,6 +1,6 @@
#include "adcore.h"
adCore::adCore(QObject *parent) :
AD_Core::AD_Core(QObject *parent) :
QThread(parent)
{
step = 0;
@@ -8,34 +8,75 @@ adCore::adCore(QObject *parent) :
//addata = new Game_Data(admap);
adloader = new Loader();
adloader->load("data2.xml");
//adloader->save("data2.xml");
addata = adloader->loadlevel(1);
if (addata != 0) qDebug("Sucsess");
else qDebug("Error");
//admap->load();
//adload->create();
//adload->readAliens();
// Player * pl1 = new Player(0);
else qFatal("Error");
Player * pl1 = new Player(0);
// Player * pl2 = new Player(0);
// addata->players.push_back(pl1);
addata->players.push_back(pl1);
// addata->players.push_back(pl2);
// adaliens = new Aliens(addata);
// adtowers = new Towers(addata);
// adsplashes = new Splashes(addata);
// connect(admap,SIGNAL(RecreateAlienPath(bool*)),adaliens,SLOT(retrace(bool*)));
// adaliens->AddAlien(0);
adaliens = new Aliens(addata);
adtowers = new Towers(addata);
adsplashes = new Splashes(addata);
connect(addata->map,SIGNAL(recreateAlienPath(bool*)),adaliens,SLOT(retrace(bool*)));
// adaliens->addAlien(0);
// adaliens->AddAlien(0);
// adaliens->AddAlien(0);
// for (int i=0; i<qMin(admap->mapsize.width(),admap->mapsize.height()); i++)
// adtowers->AddTower(0,0,QPoint(i,i));
// for (int i=0; i<admap->mapsize.height();i++)
// adtowers->AddTower(1,0,QPoint(admap->mapsize.width()-2,i));
waveInProgress = false;
startTimer(50);
}
void adCore::next()
void AD_Core::next()
{
adtowers->update();
adsplashes->update();
adaliens->update();
waveProcessing();
step++;
}
void AD_Core::timerEvent(QTimerEvent * )
{
next();
}
void AD_Core::nextWave()
{
if (waveInProgress) return;
if (addata->curWave >= addata->waves.size()) {
qDebug("level finished");
return;
}
//wavetime = addata->waves.at(addata->curWave).timeout;
qDebug() << tr("Next wave %1").arg(addata->curWave+1);
wavetime = 0;
waveInProgress = true;
}
void AD_Core::waveProcessing()
{
if (!waveInProgress) return;
if (wavetime <= 0) {
for (int i=0; i<addata->waves.at(addata->curWave).counts.size(); i++) {
if (addata->waves.at(addata->curWave).counts.at(i) > 0) {
adaliens->addAlien(addata->waves.at(addata->curWave).types.at(i));
addata->waves[addata->curWave].counts[i]--;
wavetime = addata->waves.at(addata->curWave).timeout;
return;
}
}
addata->curWave++;
waveInProgress = false;
} else {
wavetime--;
}
}

View File

@@ -8,22 +8,30 @@
#include "splashes.h"
#include "loader.h"
class adCore : public QThread
class AD_Core : public QThread
{
Q_OBJECT
public:
explicit adCore(QObject *parent = 0);
explicit AD_Core(QObject *parent = 0);
Game_Data * addata;
Aliens * adaliens;
Towers * adtowers;
Splashes * adsplashes;
Loader * adloader;
unsigned int step;
signals:
private:
void timerEvent(QTimerEvent * );
void waveProcessing();
bool waveInProgress;
int wavetime;
public slots:
void next();
private:
void nextWave();
void addTower(QPoint pos) {adtowers->addTower(0, 0, pos);};
signals:
};
#endif // ADCORE_H

Binary file not shown.

View File

@@ -6,7 +6,9 @@ HEADERS += base_types.h \
splashes.h \
adcore.h \
player.h \
loader.h
loader.h \
animation.h \
ad_graphics.h
SOURCES += map.cpp \
game_data.cpp \
aliens.cpp \
@@ -15,14 +17,14 @@ SOURCES += map.cpp \
splashes.cpp \
adcore.cpp \
player.cpp \
loader.cpp
loader.cpp \
animation.cpp \
ad_graphics.cpp
RESOURCES += images.qrc
OTHER_FILES += map.conf \
example16x16.map \
example16x12.map \
OTHER_FILES += \
data.xml \
schema.xml \
example16x16_64.map
data2.xml
QT += core \
gui \
network \

View File

@@ -16,76 +16,65 @@
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Настольный компьютер</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.DesktopTarget</value>
<value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">0</value>
<value key="ProjectExplorer.Target.ActiveDeployConfiguration" type="int">0</value>
<value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
<valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">qmake</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
<valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">qmake</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
<valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList">
<value type="QString">QMLINSPECTOR_PATH=/usr/share/qtcreator/qmljsdebugger</value>
</valuelist>
</valuemap>
<valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Сборка</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Build</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.1" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Сборка</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Сборка</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
<value type="QString">distclean</value>
</valuelist>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Clean</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value>
<valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Сборка</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
<value type="QString">clean</value>
</valuelist>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.CleanStepsCount" type="int">1</value>
<value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
<valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Отладка</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">C:/Users/Andrey/Desktop/aliendefender-build-desktop</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">9</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
</valuemap>
<valuemap key="ProjectExplorer.Target.BuildConfiguration.1" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">qmake</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
<valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
</valuemap>
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.1" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Сборка</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value>
<valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Сборка</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
<value type="QString">clean</value>
</valuelist>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.CleanStepsCount" type="int">1</value>
<value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
<value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
<valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Релиз</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">C:/Users/Andrey/Desktop/aliendefender-build-desktop</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">9</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/peri4/pprojects/aliendefender</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
</valuemap>
<value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">2</value>
<value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">1</value>
<valuemap key="ProjectExplorer.Target.DeployConfiguration.0" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
<value key="ProjectExplorer.BuildStepList.StepsCount" type="int">0</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Deploy</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">1</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">No deployment</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value key="ProjectExplorer.Target.DeployConfigurationCount" type="int">1</value>
<valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">aliendefender</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
@@ -96,8 +85,8 @@
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">true</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString">C:\Users\Andrey\Desktop\aliendefender</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
</valuemap>
@@ -106,8 +95,12 @@
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
<value type="QString">{4d5b06df-4184-42d4-9dfd-5c7caaa07ab2}</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">4</value>
<value type="int">8</value>
</data>
</qtcreator>

View File

@@ -9,7 +9,7 @@ Aliens::Aliens(Game_Data *gd, QObject *parent) :
}
void Aliens::AddAlien(int srcId)
void Aliens::addAlien(int srcId)
{
if (srcId < 0 || srcId >= gameData->srcAliens.size())
{
@@ -19,12 +19,13 @@ void Aliens::AddAlien(int srcId)
AlienType al;// = gameData->srcAliens.at(srcId);
al.Id = nextId;
al.src = srcId;
al.finish = gameData->map->Finishs().at(qrand()%gameData->map->Finishs().size());
al.pos = QPointF(gameData->map->Starts().at(qrand()%gameData->map->Starts().size()));
al.path = gameData->map->CreatePath(al.pos.toPoint(),al.finish);
al.finish = gameData->map->finishs().at(qrand()%gameData->map->finishs().size());
al.pos = QPointF(gameData->map->starts().at(qrand()%gameData->map->starts().size()));
al.path = gameData->map->createPath(al.pos.toPoint(),al.finish);
al.pathIndex = 1;
al.animIndex = 0.f;
if (al.path.isEmpty()) qFatal("ERROR create path");
qDebug() << al.path;
//qDebug() << al.path;
al.health = gameData->srcAliens.at(srcId).health;
al.speed = gameData->srcAliens.at(srcId).speed;
al.imgType = gameData->srcAliens.at(srcId).imgType;
@@ -40,14 +41,14 @@ void Aliens::retrace(bool * OK)
gameData->map->removeAliensPath();
for (int i=0; i<gameData->curAliens.size(); i++)
{
gameData->curAliens.values()[i].path = gameData->map->CreatePath(gameData->curAliens.values()[i].pos.toPoint(),gameData->curAliens.values()[i].finish);
gameData->curAliens.values()[i].path = gameData->map->createPath(gameData->curAliens.values()[i].pos.toPoint(),gameData->curAliens.values()[i].finish);
gameData->curAliens.values()[i].pathIndex = 1;
if (gameData->curAliens.values()[i].path.isEmpty()) *OK = false;
}
}
void Aliens::DelAlien(int Id)
void Aliens::delAlien(int Id)
{
gameData->curAliens.remove(Id);
}
@@ -69,7 +70,7 @@ void Aliens::update()
al.pathIndex++;
if (al.pathIndex >= al.path.size())
{
qDebug("Missing alien!");
qDebug() << tr("Missing aliens = %1!").arg(gameData->missingAliens);
missIndex.push_back(al.Id);
break;
}
@@ -102,11 +103,11 @@ void Aliens::update()
-al.speed*std::cos(arctg));
//return true;
gameData->curAliens.insert(al.Id,al);
qDebug() <<"alien"<< i << " path index" << al.pathIndex << " pos" << al.pos;
//qDebug() <<"alien"<< i << " path index=" << al.pathIndex << ", pos=" << al.pos;
}
for (int j=0; j<missIndex.size(); j++)
{
gameData->missingAliens++;
DelAlien(missIndex.at(j));
delAlien(missIndex.at(j));
}
}

View File

@@ -9,13 +9,12 @@ class Aliens : public QObject
Q_OBJECT
public:
explicit Aliens(Game_Data * gd, QObject *parent = 0);
void AddAlien(int srcId);
void nextWave();
void addAlien(int srcId);
void update();
signals:
public slots:
void DelAlien(int Id);
void delAlien(int Id);
void retrace(bool * OK);
private:
Game_Data * gameData;

23
animation.cpp Normal file
View File

@@ -0,0 +1,23 @@
#include "animation.h"
#include <QFile>
#include <QDebug>
Animation::Animation(const QString & path)
{
int i = 0;
QString s = path + QString::number(i) + ".png";
//qDebug() << "check " << s;
while (QFile::exists(s)) {
images.push_back(new QImage(s));
s = path + QString::number(++i) + ".png";
}
qDebug() << "found " << images.size() << " images";
}
Animation::~Animation()
{
}

19
animation.h Normal file
View File

@@ -0,0 +1,19 @@
#ifndef ANIMATION_H
#define ANIMATION_H
#include <QString>
#include <QImage>
class Animation
{
public:
explicit Animation(const QString & path);
~Animation();
QImage & at(int index) const {return *(images[index]);};
private:
QVector<QImage * > images;
};
#endif // ANIMATION_H

View File

@@ -14,20 +14,6 @@
#include <QRect>
#include <QRectF>
struct AlienType
{
int Id; // uses for QHash
int src;
QPointF pos;
float angle; // -180 .. 180
float speed; // cells per tick (speed=1 is 60cells by 1 sec for 60fps e.g.)
float health;
QPoint finish;
QVector <QPointF> path;
int pathIndex;
int imgType;
};
struct srcAlienType
{
@@ -43,24 +29,19 @@ struct srcAlienType
};
struct TowerType
struct AlienType
{
int Id; // uses for QHash
int src;
int aim; // aim alien Id
int oldAim;
int PlayerId; // tower's owner
int imgType;
QPoint pos; // not QPointF because tower fixed on grid
QPointF pos;
float angle; // -180 .. 180
unsigned int reload; // time for reload in ticks
unsigned int build;
};
struct TriggerType
{
int src;
unsigned int timer;
float speed; // cells per tick (speed=1 is 60cells by 1 sec for 60fps e.g.)
float health;
QPoint finish;
QVector <QPointF> path;
int pathIndex;
int imgType;
float animIndex;
};
@@ -80,7 +61,7 @@ struct srcTriggerType
allSide,
nearlestAlien
};
int childId; // =-1 for non birth splash (e.q. only damage)
int childId; // =-1 for none birth splash (e.q. only damage)
bool delParent;
float damage;
float radius;
@@ -91,6 +72,13 @@ struct srcTriggerType
};
struct TriggerType
{
int src;
unsigned int timer;
};
struct srcSplashType
{
QString name;
@@ -102,6 +90,21 @@ struct srcSplashType
};
struct SplashType
{
int Id;
int imgType;
int src;
QPoint TowerId; // parent tower (-1;-1) for null parent
int AlienId; // aim alien (different from tower.AlienId)
QPointF destination;
int life; // in ticks
float angle; // -180 .. 180
QPointF pos;
QList <TriggerType> triggers;
};
struct srcTowerType
{
QString name;
@@ -119,18 +122,17 @@ struct srcTowerType
};
struct SplashType
struct TowerType
{
int Id;
int imgType;
int src;
QPoint TowerId; // parent tower (-1;-1) for null parent
int AlienId; // aim alien (different from tower.AlienId)
QPointF destination;
int life; // in ticks
int aim; // aim alien Id
int oldAim;
int PlayerId; // tower's owner
int imgType;
QPoint pos; // not QPointF because tower fixed on grid
float angle; // -180 .. 180
QPointF pos;
QList <TriggerType> triggers;
unsigned int reload; // time for reload in ticks
unsigned int build;
};

View File

@@ -1,36 +1,64 @@
<!DOCTYPE data>
<ADdata>
<aliens>
<alien flying="true" speed="0.03" imageType="31" prise="15" id="2" score="12" name="Monstr" health="150"/>
<alien flying="true" speed="0.01" imageType="-1078580008" prise="1" id="4" score="10" name="test" health="60"/>
<alien speed="0.06" imageType="1" prise="4" id="10" score="99" name="first" health="100"/>
<alien regeneration="3" speed="0.0099" imageType="1" prise="10" armor="1.5" id="12" score="99" name="MONSTR" health="99.99"/>
<alien flying="true" speed="0.3" imageType="31" prise="15" id="2" score="12" name="Monstr" health="150"/>
<alien flying="true" speed="0.15" imageType="-1078580008" prise="1" id="4" score="10" name="test" health="60"/>
<alien speed="0.6" imageType="1" prise="4" id="10" score="99" name="first" health="100"/>
<alien regeneration="3" speed="0.5" imageType="1" prise="10" armor="1.5" id="12" score="99" name="MONSTR" health="99.99"/>
</aliens>
<maps>
<map width="16" imageType="1" height="16" id="1" data="AAAERHicY2BgEGAA4v///0hQgmFmAGlGcjCxZuCTHzUDuxkMDOr85JrBwKC0A8kMJlwYagYOeYgZ+NXgNwMtPEbNINIMIsynOO8DAG0r1Q0=" name="My Map" maxPlayers="2"/>
</maps>
<waves>
<wave prise="100" timeout="20000" id="1"/>
<wave prise="200" timeout="20000" id="2"/>
<wave prise="220" timeout="20000" id="3"/>
<wave prise="100" timeout="5" id="1"/>
<wave prise="200" timeout="5" id="2"/>
<wave prise="220" timeout="5" id="3"/>
<wave prise="220" timeout="2" id="4"/>
<wave prise="220" timeout="1" id="5"/>
<wave prise="220" timeout="10" id="6"/>
<wave prise="220" timeout="1" id="7"/>
<wave prise="220" timeout="1" id="8"/>
<wave prise="220" timeout="1" id="9"/>
<wave prise="220" timeout="1" id="10"/>
<wave prise="220" timeout="5" id="11"/>
</waves>
<levels>
<level map="1" id="1" score="138978384" name="First Level"/>
<level map="1" id="1" score="152654352" name="First Level"/>
</levels>
<waveParts>
<wavePart alien="10" count="10" wave="1"/>
<wavePart alien="12" count="5" wave="1"/>
<wavePart alien="10" count="5" wave="1"/>
<wavePart alien="12" count="6" wave="1"/>
<wavePart alien="10" count="4" wave="1"/>
<wavePart alien="10" count="9" wave="2"/>
<wavePart alien="12" count="4" wave="3"/>
<wavePart alien="12" count="3" wave="3"/>
<wavePart alien="10" count="2" wave="3"/>
<wavePart alien="10" count="1" wave="3"/>
<wavePart alien="10" count="2" wave="3"/>
<wavePart alien="12" count="3" wave="3"/>
<wavePart alien="12" count="4" wave="3"/>
<wavePart alien="2" count="20" wave="4"/>
<wavePart alien="4" count="6" wave="5"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
<wavePart alien="12" count="1" wave="6"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
</waveParts>
<wavesOnLevels>
<waveOnLevel wave="3" level="1"/>
<waveOnLevel wave="2" level="1"/>
<waveOnLevel wave="1" level="1"/>
<waveOnLevel wave="2" level="1"/>
<waveOnLevel wave="3" level="1"/>
<waveOnLevel wave="4" level="1"/>
<waveOnLevel wave="5" level="1"/>
<waveOnLevel wave="6" level="1"/>
</wavesOnLevels>
<splashes>
<splash speed="0.2" imageType="1" lifetime="9999" id="1" name="rocket"/>
@@ -50,15 +78,15 @@
<trigger childAim="noAim" count="1" type="onTimer" id="4" name="smoke"/>
</triggers>
<chains>
<chain tower="1" trigger="4" child="5" parent="1"/>
<chain tower="1" trigger="3" child="4" parent="1"/>
<chain tower="1" trigger="4" child="5" parent="1"/>
<chain tower="2" trigger="2" parent="3"/>
<chain tower="3" trigger="4" child="5" parent="2"/>
<chain tower="3" trigger="3" child="4" parent="2"/>
<chain tower="3" trigger="4" child="5" parent="2"/>
</chains>
<towersOnLevels>
<towerOnLevel tower="3" level="1"/>
<towerOnLevel tower="2" level="1"/>
<towerOnLevel tower="1" level="1"/>
<towerOnLevel tower="2" level="1"/>
<towerOnLevel tower="3" level="1"/>
</towersOnLevels>
</ADdata>

Binary file not shown.

Binary file not shown.

View File

@@ -1 +0,0 @@
AAAERHicY2BgEGAA4v///0hQgmFmAGlGcjCxZuCTHzUDuxkMDOr85JrBwKC0A8kMJlwYagYOeYgZ+NXgNwMtPEbNINIMIsynOO8DAG0r1Q0=

View File

@@ -1,5 +1,5 @@
<RCC>
<qresource prefix="/aliens">
<qresource prefix="/images">
<file>images/Aliens/Al_00_0.png</file>
<file>images/Aliens/Al_00_1.png</file>
<file>images/Aliens/Al_00_2.png</file>

View File

@@ -388,7 +388,7 @@ void Loader::fillTowerChains(QList <tbChain> * chlist, QList <int> * trigIds, sr
}
}
QString Loader::CreateMapExample()
QString Loader::createMapExample()
{
QVector < QVector < int > > Cells;
Cells.resize(16);
@@ -448,11 +448,11 @@ void Loader::readAliens()
al.score = nm.namedItem("score").nodeValue().toInt();
al.isFlying = (nm.namedItem("flying").nodeValue() == "true");
aliens.insert(al.id,al);
qDebug() << tr("Alien %1 id=%2 health=%3 speed=%4 prise=%5 imgType=%6 armor=%7 regeneration=%8 score=%10").arg(al.name).arg(al.id).arg(al.health).arg(al.speed).arg(al.prise).arg(al.imgType).arg(al.armor).arg(al.regeneration).arg(al.score);
//qDebug() << tr("Alien %1 id=%2 health=%3 speed=%4 prise=%5 imgType=%6 armor=%7 regeneration=%8 score=%10").arg(al.name).arg(al.id).arg(al.health).arg(al.speed).arg(al.prise).arg(al.imgType).arg(al.armor).arg(al.regeneration).arg(al.score);
}
qDebug("================");
//qDebug("================");
qDebug() << tr("Found %1 aliens").arg(aliens.size());
qDebug("================");
//qDebug("================");
}
@@ -469,11 +469,11 @@ void Loader::readWaves()
w.prise = nm.namedItem("prise").nodeValue().toInt();
w.timeout = nm.namedItem("timeout").nodeValue().toInt();
waves.insert(w.id,w);
qDebug() << tr("Wave %1 prise=%2 timeout=%3").arg(w.id).arg(w.prise).arg(w.timeout);
//qDebug() << tr("Wave %1 prise=%2 timeout=%3").arg(w.id).arg(w.prise).arg(w.timeout);
}
qDebug("================");
//qDebug("================");
qDebug() << tr("Found %1 waves").arg(waves.size());
qDebug("================");
//qDebug("================");
}
@@ -502,12 +502,12 @@ void Loader::readWaveParts()
if (OK)
{
waveParts.insert(wp.waveId,wp);
qDebug() << tr("Wave=%1 alien=%2 count=%3").arg(wp.waveId).arg(wp.alienId).arg(wp.count);
//qDebug() << tr("Wave=%1 alien=%2 count=%3").arg(wp.waveId).arg(wp.alienId).arg(wp.count);
}
}
qDebug("================");
//qDebug("================");
qDebug() << tr("Found %1 waveParts").arg(waveParts.size());
qDebug("================");
//qDebug("================");
}
@@ -550,12 +550,12 @@ void Loader::readChains()
if (OK)
{
chains.insert(chain.towerId,chain);
qDebug() << tr("Tower=%1 parent=%2 child=%3 trigger=%4").arg(chain.towerId).arg(chain.parentSplashId).arg(chain.childSplashId).arg(chain.triggerId);
//qDebug() << tr("Tower=%1 parent=%2 child=%3 trigger=%4").arg(chain.towerId).arg(chain.parentSplashId).arg(chain.childSplashId).arg(chain.triggerId);
}
}
qDebug("================");
//qDebug("================");
qDebug() << tr("Found %1 chains").arg(chains.size());
qDebug("================");
//qDebug("================");
}
@@ -583,12 +583,12 @@ void Loader::readLevWaves()
if (OK)
{
levWaves.insert(lw.levelId,lw);
qDebug() << tr("level=%1 wave=%2").arg(lw.levelId).arg(lw.waveId);
//qDebug() << tr("level=%1 wave=%2").arg(lw.levelId).arg(lw.waveId);
}
}
qDebug("================");
//qDebug("================");
qDebug() << tr("Found %1 Waves On Level").arg(levWaves.size());
qDebug("================");
//qDebug("================");
}
@@ -616,12 +616,12 @@ void Loader::readLevTowers()
if (OK)
{
levTowers.insert(lt.levelId,lt);
qDebug() << tr("level=%1 tower=%2").arg(lt.levelId).arg(lt.towerId);
//qDebug() << tr("level=%1 tower=%2").arg(lt.levelId).arg(lt.towerId);
}
}
qDebug("================");
//qDebug("================");
qDebug() << tr("Found %1 Towers On Level").arg(levTowers.size());
qDebug("================");
//qDebug("================");
}
@@ -646,12 +646,12 @@ void Loader::readLevels()
if (OK)
{
levels.insert(l.id,l);
qDebug() << tr("Level %1 id=%2 map=%3 ").arg(l.name).arg(l.id).arg(l.mapId);
//qDebug() << tr("Level %1 id=%2 map=%3 ").arg(l.name).arg(l.id).arg(l.mapId);
}
}
qDebug("================");
//qDebug("================");
qDebug() << tr("Found %1 levels").arg(levels.size());
qDebug("================");
//qDebug("================");
}
@@ -692,12 +692,12 @@ void Loader::readTriggers()
if (str == "nearlestAlien")
trig.childAim = srcTriggerType::nearlestAlien;
triggers.insert(trig.id,trig);
qDebug() << tr("Trigger %1 id=%2 damage=%3 radius=%4 delParent=%5 timer=%6").arg(trig.name).arg(trig.id).arg(trig.damage).arg(trig.radius).arg(trig.delParent).arg(trig.timer)
<< tr("count=%1 chance=%2 randomPosRadius=%3 type=%4 childAim=%5").arg(trig.count).arg(trig.chance).arg(trig.randomPosRadius).arg(trig.type).arg(trig.childAim);
//qDebug() << tr("Trigger %1 id=%2 damage=%3 radius=%4 delParent=%5 timer=%6").arg(trig.name).arg(trig.id).arg(trig.damage).arg(trig.radius).arg(trig.delParent).arg(trig.timer)
// << tr("count=%1 chance=%2 randomPosRadius=%3 type=%4 childAim=%5").arg(trig.count).arg(trig.chance).arg(trig.randomPosRadius).arg(trig.type).arg(trig.childAim);
}
qDebug("================");
//qDebug("================");
qDebug() << tr("Found %1 triggers").arg(triggers.size());
qDebug("================");
//qDebug("================");
}
@@ -719,11 +719,11 @@ void Loader::readSplashes()
str = nm.namedItem("autoControl").nodeValue();
s.autoControl = (str == "true");
splashes.insert(s.id,s);
qDebug() << tr("Splash %1 id=%2 speed=%3 imgType=%4 autoControl=%5 lifetime=%6").arg(s.name).arg(s.id).arg(s.speed).arg(s.imgType).arg(s.autoControl).arg(s.lifetime);
//qDebug() << tr("Splash %1 id=%2 speed=%3 imgType=%4 autoControl=%5 lifetime=%6").arg(s.name).arg(s.id).arg(s.speed).arg(s.imgType).arg(s.autoControl).arg(s.lifetime);
}
qDebug("================");
//qDebug("================");
qDebug() << tr("Found %1 splashes").arg(splashes.size());
qDebug("================");
//qDebug("================");
}
@@ -756,13 +756,13 @@ void Loader::readTowers()
if (OK)
{
towers.insert(tw.id,tw);
qDebug() << tr("Tower %1 id=%2 radius=%3 cost=%4 reload=%5 buildTime=%6 splash=%7").arg(tw.name).arg(tw.id).arg(tw.radius).arg(tw.cost).arg(tw.reload).arg(tw.buildTime).arg(tw.splashId)
<< tr("imgType=%1 expByKill=%2 expByShot=%3 expByDamage=%4").arg(tw.imgType).arg(tw.expByKill).arg(tw.expByShot).arg(tw.expByDamage);
//qDebug() << tr("Tower %1 id=%2 radius=%3 cost=%4 reload=%5 buildTime=%6 splash=%7").arg(tw.name).arg(tw.id).arg(tw.radius).arg(tw.cost).arg(tw.reload).arg(tw.buildTime).arg(tw.splashId)
// << tr("imgType=%1 expByKill=%2 expByShot=%3 expByDamage=%4").arg(tw.imgType).arg(tw.expByKill).arg(tw.expByShot).arg(tw.expByDamage);
}
}
qDebug("================");
//qDebug("================");
qDebug() << tr("Found %1 towers").arg(towers.size());
qDebug("================");
//qDebug("================");
}
@@ -783,11 +783,11 @@ void Loader::readMaps()
m.size.setWidth(mn.namedItem("width").nodeValue().toInt());
m.size.setHeight(mn.namedItem("height").nodeValue().toInt());
maps.insert(m.id,m);
qDebug() << tr("Map %1 id=%2 imgType=%3 maxPlayers=%5 data=%6 ").arg(m.name).arg(m.id).arg(m.imgType).arg(m.maxPlayers).arg(QString(m.data)) << m.size;
//qDebug() << tr("Map %1 id=%2 imgType=%3 maxPlayers=%5 data=%6 ").arg(m.name).arg(m.id).arg(m.imgType).arg(m.maxPlayers).arg(QString(m.data)) << m.size;
}
qDebug("================");
//qDebug("================");
qDebug() << tr("Found %1 maps").arg(maps.size());
qDebug("================");
//qDebug("================");
}

View File

@@ -179,7 +179,7 @@ private:
void fillTowerChains(QList <tbChain> * chlist, QList <int> * trigIds, srcTowerType * stt, int parId, int parIndex, int * recursiveCheck);
void validate(QString filename);
QString CreateMapExample();
QString createMapExample();
};
#endif // LOADER_H

View File

@@ -2,15 +2,17 @@
#include <QTimer>
#include "adcore.h"
#include "ad_graphics.h"
int main(int argc, char *argv[])
{
adCore core;
QApplication a(argc, argv);
AD_Core core;
AD_Graphics graphics(&core);
graphics.resize(800,600);
//QTimer * timer = new QTimer();
//QObject::connect(timer,SIGNAL(timeout()),&core,SLOT(next()));
//timer->start(100);
//return a.exec();
return 0;
return a.exec();
}

View File

@@ -1,3 +0,0 @@
cells path = example16x16.map
max players = 2

65
map.cpp
View File

@@ -27,11 +27,12 @@ Map::Map(QByteArray data, QSize size, QString name, int maxPlayers, int image, Q
}
for (int j=0; j<Cells[i].size(); j++)
{
if (Cells[i][j]==Start) starts.push_back(QPoint(i,j));
if (Cells[i][j]==Finish) finishs.push_back(QPoint(i,j));
if (Cells[i][j]==Start) Starts.push_back(QPoint(i,j));
if (Cells[i][j]==Finish) Finishs.push_back(QPoint(i,j));
}
}
if (starts.isEmpty() || finishs.isEmpty()) qFatal("invalid map, not found start/finish");
mapSize.setHeight(chei);
if (Starts.isEmpty() || Finishs.isEmpty()) qFatal("invalid map, not found start/finish");
// TODO: check for maxPlayers
players = maxPlayers;
imageType = image;
@@ -91,9 +92,9 @@ bool Map::addTowerOnMap(int playerId, QPoint pos)
{
Cells[pos.x()][pos.y()]=PlayerTower-playerId;
bool ok=true;
for (int i=0; i<starts.size(); i++)
for (int j=0; j<finishs.size(); j++)
if (WaveTrace(starts.at(i),finishs.at(j))<0) ok = false;
for (int i=0; i<Starts.size(); i++)
for (int j=0; j<Finishs.size(); j++)
if (waveTrace(Starts.at(i),Finishs.at(j))<0) ok = false;
qDebug()<<"ok="<<ok;
if (!ok)
{
@@ -105,12 +106,12 @@ bool Map::addTowerOnMap(int playerId, QPoint pos)
pathOK = new bool();
*pathOK = true;
qDebug("emit");
emit RecreateAlienPath(pathOK);
emit recreateAlienPath(pathOK);
qDebug() << *pathOK;
if (!pathOK)
{
Cells[pos.x()][pos.y()]=PlayerAlien+playerId;
emit RecreateAlienPath(pathOK);
emit recreateAlienPath(pathOK);
return false;
}
return true;
@@ -166,7 +167,7 @@ bool Map::addTowerOnMap(int playerId, QPoint pos)
//}
QVector<QPointF> Map::CreatePath(QPoint start, QPoint finish)
QVector<QPointF> Map::createPath(QPoint start, QPoint finish)
{
QPointF tp;
QVector<QPoint> srcPath;
@@ -175,7 +176,7 @@ QVector<QPointF> Map::CreatePath(QPoint start, QPoint finish)
//PathIndex = 1;
if (Cells[start.x()][start.y()] < 0) qDebug("ERROR invalid start"),exit(-1);
if (Cells[finish.x()][finish.y()] < 0) qDebug("ERROR invalid finish"),exit(-1);
srcPath = InvWaveTrace(finish,WaveTrace(start,finish));
srcPath = invWaveTrace(finish,waveTrace(start,finish));
for (int i=0; i<srcPath.size();i++)
{
int x = Cells.at(srcPath.at(i).x()).at(srcPath.at(i).y());
@@ -218,7 +219,7 @@ QVector<QPointF> Map::CreatePath(QPoint start, QPoint finish)
}
int Map::WaveTrace(QPoint start, QPoint finish)
int Map::waveTrace(QPoint start, QPoint finish)
{
bool stop = false;
int step = 2;
@@ -251,29 +252,37 @@ int Map::WaveTrace(QPoint start, QPoint finish)
}
tp.setX(cp.x() - 1);
tp.setY(cp.y());
if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) {
TmpCells[tp.x()][tp.y()] = step;
curp.push_back(tp);
stop = false;
if (fr.contains(tp)) {
if (TmpCells[tp.x()][tp.y()] == 0) {
TmpCells[tp.x()][tp.y()] = step;
curp.push_back(tp);
stop = false;
}
}
tp.setX(cp.x() + 1);
if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) {
TmpCells[tp.x()][tp.y()] = step;
curp.push_back(tp);
stop = false;
if (fr.contains(tp)) {
if (TmpCells[tp.x()][tp.y()] == 0) {
TmpCells[tp.x()][tp.y()] = step;
curp.push_back(tp);
stop = false;
}
}
tp.setX(cp.x());
tp.setY(cp.y() - 1);
if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) {
TmpCells[tp.x()][tp.y()] = step;
curp.push_back(tp);
stop = false;
if (fr.contains(tp)) {
if (TmpCells[tp.x()][tp.y()] == 0) {
TmpCells[tp.x()][tp.y()] = step;
curp.push_back(tp);
stop = false;
}
}
tp.setY(cp.y() + 1);
if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) {
TmpCells[tp.x()][tp.y()] = step;
curp.push_back(tp);
stop = false;
if (fr.contains(tp)) {
if (TmpCells[tp.x()][tp.y()] == 0) {
TmpCells[tp.x()][tp.y()] = step;
curp.push_back(tp);
stop = false;
}
}
}
step++;
@@ -284,7 +293,7 @@ int Map::WaveTrace(QPoint start, QPoint finish)
}
QVector<QPoint> Map::InvWaveTrace(QPoint finish, int cnt)
QVector<QPoint> Map::invWaveTrace(QPoint finish, int cnt)
{
QPoint wp, Ppnt;
QVector<QPoint> alpath;

21
map.h
View File

@@ -35,14 +35,15 @@ public:
bool isFreePlace(QPoint pos);
void delTowerOnMap(QPoint pos);
void removeAliensPath();
QVector <QPointF> CreatePath(QPoint start, QPoint finish);
QRect Rect() const {return QRect(QPoint(),mapSize);}
QVector <QPointF> createPath(QPoint start, QPoint finish);
QRect rect() const {return QRect(QPoint(),mapSize);}
// QString name() const {return mapName;}
QList <QPoint> Starts() const {return starts;}
QList <QPoint> Finishs() const {return finishs;}
int Image() const {return imageType;}
QList <QPoint> starts() const {return Starts;}
QList <QPoint> finishs() const {return Finishs;}
QVector < QVector <int> > cells() const {return Cells;}
int image() const {return imageType;}
signals:
void RecreateAlienPath(bool * pathOK);
void recreateAlienPath(bool * pathOK);
public slots:
void printMap();
@@ -52,13 +53,13 @@ private:
int players;
int imageType;
QVector < QVector <int> > Cells;
QList <QPoint> starts;
QList <QPoint> finishs;
QList <QPoint> Starts;
QList <QPoint> Finishs;
QVector < QVector <int> > TmpCells;
QVector<QPoint> InvWaveTrace(QPoint finish, int cnt);
int WaveTrace(QPoint start, QPoint finish);
QVector<QPoint> invWaveTrace(QPoint finish, int cnt);
int waveTrace(QPoint start, QPoint finish);
//void CreateMapExample();
//void ReadSettings();
};

View File

@@ -9,7 +9,7 @@ Splashes::Splashes(Game_Data *gd, QObject *parent) :
}
bool Splashes::AddSplash(int srcId, QPointF pos)
bool Splashes::addSplash(int srcId, QPointF pos)
{
if (srcId < 0 || srcId >= gameData->srcSplashes.size())
{
@@ -23,7 +23,7 @@ bool Splashes::AddSplash(int srcId, QPointF pos)
spl.TowerId = QPoint(-1,-1);
spl.life = 0;
spl.imgType = src.imgType;
if (!gameData->map->Rect().contains(pos.toPoint()))
if (!gameData->map->rect().contains(pos.toPoint()))
{
qCritical("ERROR splash out of map size");
return false;
@@ -33,7 +33,7 @@ bool Splashes::AddSplash(int srcId, QPointF pos)
spl.angle = 0;
spl.destination = pos;
TriggerType trig;
for(int i; i<src.triggerIndexes.size(); i++)
for(int i=0; i<src.triggerIndexes.size(); i++)
{
trig.timer = gameData->srTriggers.at(src.triggerIndexes.at(i)).timer;
trig.src = src.triggerIndexes.at(i);
@@ -45,7 +45,7 @@ bool Splashes::AddSplash(int srcId, QPointF pos)
}
void Splashes::AddSplash(srcSplashType src, int index, TowerType tw)
void Splashes::addSplash(srcSplashType src, int index, TowerType tw)
{
SplashType spl;
spl.Id = nextId;
@@ -63,7 +63,7 @@ void Splashes::AddSplash(srcSplashType src, int index, TowerType tw)
spl.life = 0;
spl.src = index;
TriggerType trig;
for(int i; i<src.triggerIndexes.size(); i++)
for(int i=0; i<src.triggerIndexes.size(); i++)
{
trig.timer = gameData->players.at(tw.PlayerId)->srcTowers.at(tw.src).triggers.at(src.triggerIndexes.at(i)).timer;
trig.src = src.triggerIndexes.at(i);
@@ -76,13 +76,13 @@ void Splashes::AddSplash(srcSplashType src, int index, TowerType tw)
void Splashes::update()
{
for (int i; i<gameData->curSplashes.size(); i++)
for (int i=0; i<gameData->curSplashes.size(); i++)
{
SplashType spl = gameData->curSplashes.values().at(i);
bool isTowerSplash = false;
srcSplashType src;
TowerType tw;
if (gameData->map->Rect().contains(spl.TowerId))
if (gameData->map->rect().contains(spl.TowerId))
{
if (gameData->curTowers.contains(spl.TowerId))
{

View File

@@ -8,13 +8,13 @@ class Splashes : public QObject
Q_OBJECT
public:
explicit Splashes(Game_Data * gd, QObject *parent = 0);
bool AddSplash(int srcId, QPointF pos);
void DelSplash(int Id);
bool addSplash(int srcId, QPointF pos);
void delSplash(int Id);
void update();
signals:
public slots:
void AddSplash(srcSplashType src, int index, TowerType tw);
void addSplash(srcSplashType src, int index, TowerType tw);
private:
Game_Data *gameData;

View File

@@ -6,7 +6,7 @@ Towers::Towers(Game_Data *gd, QObject *parent) :
gameData = gd;
}
bool Towers::AddTower(int playerId, int srcId, QPoint pos)
bool Towers::addTower(int playerId, int srcId, QPoint pos)
{
//QByteArray ar;
//ar << pos;
@@ -40,7 +40,7 @@ bool Towers::AddTower(int playerId, int srcId, QPoint pos)
}
void Towers::DelTower(QPoint pos)
void Towers::delTower(QPoint pos)
{
gameData->curTowers.remove(pos);
}
@@ -48,7 +48,7 @@ void Towers::DelTower(QPoint pos)
void Towers::update()
{
for (int i; i<gameData->curTowers.size(); i++)
for (int i=0; i<gameData->curTowers.size(); i++)
{
TowerType tw = gameData->curTowers.values().at(i);
srcTowerType stw = gameData->players.at(tw.PlayerId)->srcTowers.at(tw.src);

View File

@@ -8,8 +8,8 @@ class Towers : public QObject
Q_OBJECT
public:
explicit Towers(Game_Data * gd, QObject *parent = 0);
bool AddTower(int playerId, int srcId, QPoint pos);
void DelTower(QPoint pos);
bool addTower(int playerId, int srcId, QPoint pos);
void delTower(QPoint pos);
void update();
signals:
void shot(srcSplashType src, int index, TowerType tw);