global restruct finish 2 of 3

This commit is contained in:
2010-02-07 19:22:29 +03:00
parent 86f5e2f625
commit 105c340243
20 changed files with 1103 additions and 249 deletions

145
Makefile Normal file
View File

@@ -0,0 +1,145 @@
#############################################################################
# Makefile for building: aliendefender
# Generated by qmake (2.01a) (Qt 4.6.1) on: ?? 7. ??? 19:16:37 2010
# Project: aliendefender.pro
# Template: app
# Command: d:\qt\2010.01\qt\bin\qmake.exe -Wall -spec d:\Qt\2010.01\qt\mkspecs\win32-g++ -win32 -o Makefile aliendefender.pro
#############################################################################
first: debug
install: debug-install
uninstall: debug-uninstall
MAKEFILE = Makefile
QMAKE = d:\qt\2010.01\qt\bin\qmake.exe
DEL_FILE = del
CHK_DIR_EXISTS= if not exist
MKDIR = mkdir
COPY = copy /y
COPY_FILE = $(COPY)
COPY_DIR = xcopy /s /q /y /i
INSTALL_FILE = $(COPY_FILE)
INSTALL_PROGRAM = $(COPY_FILE)
INSTALL_DIR = $(COPY_DIR)
DEL_FILE = del
SYMLINK =
DEL_DIR = rmdir
MOVE = move
CHK_DIR_EXISTS= if not exist
MKDIR = mkdir
SUBTARGETS = \
debug \
release
debug: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug
debug-make_default: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug
debug-make_first: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug first
debug-all: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug all
debug-clean: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug clean
debug-distclean: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug distclean
debug-install: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug install
debug-uninstall: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug uninstall
release: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release
release-make_default: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release
release-make_first: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release first
release-all: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release all
release-clean: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release clean
release-distclean: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release distclean
release-install: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release install
release-uninstall: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release uninstall
Makefile: aliendefender.pro d:/Qt/2010.01/qt/mkspecs/win32-g++/qmake.conf d:/Qt/2010.01/qt/mkspecs/qconfig.pri \
d:/Qt/2010.01/qt/mkspecs/features/qt_functions.prf \
d:/Qt/2010.01/qt/mkspecs/features/qt_config.prf \
d:/Qt/2010.01/qt/mkspecs/features/exclusive_builds.prf \
d:/Qt/2010.01/qt/mkspecs/features/default_pre.prf \
d:/Qt/2010.01/qt/mkspecs/features/win32/default_pre.prf \
d:/Qt/2010.01/qt/mkspecs/features/debug.prf \
d:/Qt/2010.01/qt/mkspecs/features/debug_and_release.prf \
d:/Qt/2010.01/qt/mkspecs/features/default_post.prf \
d:/Qt/2010.01/qt/mkspecs/features/win32/default_post.prf \
d:/Qt/2010.01/qt/mkspecs/features/win32/rtti.prf \
d:/Qt/2010.01/qt/mkspecs/features/win32/exceptions.prf \
d:/Qt/2010.01/qt/mkspecs/features/win32/stl.prf \
d:/Qt/2010.01/qt/mkspecs/features/shared.prf \
d:/Qt/2010.01/qt/mkspecs/features/warn_on.prf \
d:/Qt/2010.01/qt/mkspecs/features/qt.prf \
d:/Qt/2010.01/qt/mkspecs/features/win32/opengl.prf \
d:/Qt/2010.01/qt/mkspecs/features/win32/thread.prf \
d:/Qt/2010.01/qt/mkspecs/features/moc.prf \
d:/Qt/2010.01/qt/mkspecs/features/win32/windows.prf \
d:/Qt/2010.01/qt/mkspecs/features/resources.prf \
d:/Qt/2010.01/qt/mkspecs/features/uic.prf \
d:/Qt/2010.01/qt/mkspecs/features/yacc.prf \
d:/Qt/2010.01/qt/mkspecs/features/lex.prf \
d:/Qt/2010.01/qt/mkspecs/features/include_source_dir.prf \
d:/Qt/2010.01/qt/lib/qtmaind.prl
$(QMAKE) -Wall -spec d:\Qt\2010.01\qt\mkspecs\win32-g++ -win32 -o Makefile aliendefender.pro
d:\Qt\2010.01\qt\mkspecs\qconfig.pri:
d:\Qt\2010.01\qt\mkspecs\features\qt_functions.prf:
d:\Qt\2010.01\qt\mkspecs\features\qt_config.prf:
d:\Qt\2010.01\qt\mkspecs\features\exclusive_builds.prf:
d:\Qt\2010.01\qt\mkspecs\features\default_pre.prf:
d:\Qt\2010.01\qt\mkspecs\features\win32\default_pre.prf:
d:\Qt\2010.01\qt\mkspecs\features\debug.prf:
d:\Qt\2010.01\qt\mkspecs\features\debug_and_release.prf:
d:\Qt\2010.01\qt\mkspecs\features\default_post.prf:
d:\Qt\2010.01\qt\mkspecs\features\win32\default_post.prf:
d:\Qt\2010.01\qt\mkspecs\features\win32\rtti.prf:
d:\Qt\2010.01\qt\mkspecs\features\win32\exceptions.prf:
d:\Qt\2010.01\qt\mkspecs\features\win32\stl.prf:
d:\Qt\2010.01\qt\mkspecs\features\shared.prf:
d:\Qt\2010.01\qt\mkspecs\features\warn_on.prf:
d:\Qt\2010.01\qt\mkspecs\features\qt.prf:
d:\Qt\2010.01\qt\mkspecs\features\win32\opengl.prf:
d:\Qt\2010.01\qt\mkspecs\features\win32\thread.prf:
d:\Qt\2010.01\qt\mkspecs\features\moc.prf:
d:\Qt\2010.01\qt\mkspecs\features\win32\windows.prf:
d:\Qt\2010.01\qt\mkspecs\features\resources.prf:
d:\Qt\2010.01\qt\mkspecs\features\uic.prf:
d:\Qt\2010.01\qt\mkspecs\features\yacc.prf:
d:\Qt\2010.01\qt\mkspecs\features\lex.prf:
d:\Qt\2010.01\qt\mkspecs\features\include_source_dir.prf:
d:\Qt\2010.01\qt\lib\qtmaind.prl:
qmake: qmake_all FORCE
@$(QMAKE) -Wall -spec d:\Qt\2010.01\qt\mkspecs\win32-g++ -win32 -o Makefile aliendefender.pro
qmake_all: FORCE
make_default: debug-make_default release-make_default FORCE
make_first: debug-make_first release-make_first FORCE
all: debug-all release-all FORCE
clean: debug-clean release-clean FORCE
distclean: debug-distclean release-distclean FORCE
-$(DEL_FILE) Makefile
debug-mocclean: $(MAKEFILE).Debug
$(MAKE) -f $(MAKEFILE).Debug mocclean
release-mocclean: $(MAKEFILE).Release
$(MAKE) -f $(MAKEFILE).Release mocclean
mocclean: debug-mocclean release-mocclean
debug-mocables: $(MAKEFILE).Debug
$(MAKE) -f $(MAKEFILE).Debug mocables
release-mocables: $(MAKEFILE).Release
$(MAKE) -f $(MAKEFILE).Release mocables
mocables: debug-mocables release-mocables
FORCE:
$(MAKEFILE).Debug: Makefile
$(MAKEFILE).Release: Makefile

250
Makefile.Debug Normal file
View File

@@ -0,0 +1,250 @@
#############################################################################
# Makefile for building: aliendefender
# Generated by qmake (2.01a) (Qt 4.6.1) on: ?? 7. ??? 19:16:37 2010
# Project: aliendefender.pro
# Template: app
#############################################################################
####### Compiler, tools and options
CC = gcc
CXX = g++
DEFINES = -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
CFLAGS = -g -Wall $(DEFINES)
CXXFLAGS = -g -frtti -fexceptions -mthreads -Wall $(DEFINES)
INCPATH = -I"d:\Qt\2010.01\qt\include\QtCore" -I"d:\Qt\2010.01\qt\include\QtNetwork" -I"d:\Qt\2010.01\qt\include\QtGui" -I"d:\Qt\2010.01\qt\include\QtOpenGL" -I"d:\Qt\2010.01\qt\include" -I"d:\Qt\2010.01\qt\include\ActiveQt" -I"debug" -I"." -I"d:\Qt\2010.01\qt\mkspecs\win32-g++"
LINK = g++
LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows
LIBS = -L"d:\Qt\2010.01\qt\lib" -lopengl32 -lglu32 -lgdi32 -luser32 -lmingw32 -lqtmaind -lQtOpenGLd4 -lQtGuid4 -lQtNetworkd4 -lQtCored4
QMAKE = d:\qt\2010.01\qt\bin\qmake.exe
IDC = d:\Qt\2010.01\qt\bin\idc.exe
IDL = midl
ZIP = zip -r -9
DEF_FILE =
RES_FILE =
COPY = copy /y
COPY_FILE = $(COPY)
COPY_DIR = xcopy /s /q /y /i
DEL_FILE = del
DEL_DIR = rmdir
MOVE = move
CHK_DIR_EXISTS= if not exist
MKDIR = mkdir
INSTALL_FILE = $(COPY_FILE)
INSTALL_PROGRAM = $(COPY_FILE)
INSTALL_DIR = $(COPY_DIR)
####### Output directory
OBJECTS_DIR = debug
####### Files
SOURCES = main.cpp \
mainwindow.cpp \
adpainter.cpp \
aliens.cpp \
udpsender.cpp \
towers.cpp \
map.cpp \
games.cpp \
alien.cpp debug\moc_mainwindow.cpp \
debug\moc_udpsender.cpp \
debug\qrc_images.cpp
OBJECTS = debug/main.o \
debug/mainwindow.o \
debug/adpainter.o \
debug/aliens.o \
debug/udpsender.o \
debug/towers.o \
debug/map.o \
debug/games.o \
debug/alien.o \
debug/moc_mainwindow.o \
debug/moc_udpsender.o \
debug/qrc_images.o
DIST =
QMAKE_TARGET = aliendefender
DESTDIR = debug\ #avoid trailing-slash linebreak
TARGET = aliendefender.exe
DESTDIR_TARGET = debug\aliendefender.exe
####### Implicit rules
.SUFFIXES: .cpp .cc .cxx .c
.cpp.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.cc.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.cxx.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.c.o:
$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
####### Build rules
first: all
all: Makefile.Debug $(DESTDIR_TARGET)
$(DESTDIR_TARGET): ui_mainwindow.h $(OBJECTS)
$(LINK) $(LFLAGS) -o $(DESTDIR_TARGET) object_script.aliendefender.Debug $(LIBS)
qmake: FORCE
@$(QMAKE) -Wall -spec d:\Qt\2010.01\qt\mkspecs\win32-g++ -win32 -o Makefile.Debug aliendefender.pro
dist:
$(ZIP) aliendefender.zip $(SOURCES) $(DIST) aliendefender.pro d:\Qt\2010.01\qt\mkspecs\qconfig.pri d:\Qt\2010.01\qt\mkspecs\features\qt_functions.prf d:\Qt\2010.01\qt\mkspecs\features\qt_config.prf d:\Qt\2010.01\qt\mkspecs\features\exclusive_builds.prf d:\Qt\2010.01\qt\mkspecs\features\default_pre.prf d:\Qt\2010.01\qt\mkspecs\features\win32\default_pre.prf d:\Qt\2010.01\qt\mkspecs\features\debug.prf d:\Qt\2010.01\qt\mkspecs\features\debug_and_release.prf d:\Qt\2010.01\qt\mkspecs\features\default_post.prf d:\Qt\2010.01\qt\mkspecs\features\win32\default_post.prf d:\Qt\2010.01\qt\mkspecs\features\build_pass.prf d:\Qt\2010.01\qt\mkspecs\features\win32\rtti.prf d:\Qt\2010.01\qt\mkspecs\features\win32\exceptions.prf d:\Qt\2010.01\qt\mkspecs\features\win32\stl.prf d:\Qt\2010.01\qt\mkspecs\features\shared.prf d:\Qt\2010.01\qt\mkspecs\features\warn_on.prf d:\Qt\2010.01\qt\mkspecs\features\qt.prf d:\Qt\2010.01\qt\mkspecs\features\win32\opengl.prf d:\Qt\2010.01\qt\mkspecs\features\win32\thread.prf d:\Qt\2010.01\qt\mkspecs\features\moc.prf d:\Qt\2010.01\qt\mkspecs\features\win32\windows.prf d:\Qt\2010.01\qt\mkspecs\features\resources.prf d:\Qt\2010.01\qt\mkspecs\features\uic.prf d:\Qt\2010.01\qt\mkspecs\features\yacc.prf d:\Qt\2010.01\qt\mkspecs\features\lex.prf d:\Qt\2010.01\qt\mkspecs\features\include_source_dir.prf d:\Qt\2010.01\qt\lib\qtmaind.prl HEADERS RESOURCES IMAGES SOURCES OBJECTIVE_SOURCES FORMS YACCSOURCES YACCSOURCES LEXSOURCES
clean: compiler_clean
-$(DEL_FILE) debug\main.o debug\mainwindow.o debug\adpainter.o debug\aliens.o debug\udpsender.o debug\towers.o debug\map.o debug\games.o debug\alien.o debug\moc_mainwindow.o debug\moc_udpsender.o debug\qrc_images.o
distclean: clean
-$(DEL_FILE) $(DESTDIR_TARGET)
-$(DEL_FILE) Makefile.Debug
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: debug/moc_mainwindow.cpp debug/moc_udpsender.cpp
compiler_moc_header_clean:
-$(DEL_FILE) debug\moc_mainwindow.cpp debug\moc_udpsender.cpp
debug/moc_mainwindow.cpp: aliens.h \
alien.h \
games.h \
basestruct.h \
map.h \
towers.h \
udpsender.h \
mainwindow.h
D:/Qt/2010.01/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 mainwindow.h -o debug\moc_mainwindow.cpp
debug/moc_udpsender.cpp: udpsender.h
D:/Qt/2010.01/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 udpsender.h -o debug\moc_udpsender.cpp
compiler_rcc_make_all: debug/qrc_images.cpp
compiler_rcc_clean:
-$(DEL_FILE) debug\qrc_images.cpp
debug/qrc_images.cpp: images.qrc \
images/Aliens/Al_00_12.png \
images/Aliens/Al_00_6.png \
images/Aliens/Al_00_2.png \
images/Aliens/Al_00_17.png \
images/Aliens/Al_00_13.png \
images/Aliens/Al_00_7.png \
images/Aliens/Al_00_3.png \
images/Aliens/Al_00_18.png \
images/Aliens/Al_00_10.png \
images/Aliens/Al_00_14.png \
images/Aliens/Al_00_8.png \
images/Aliens/Al_00_4.png \
images/Aliens/Al_00_0.png \
images/Aliens/Al_00_19.png \
images/Aliens/Al_00_11.png \
images/Aliens/Al_00_15.png \
images/Aliens/Al_00_9.png \
images/Aliens/Al_00_5.png \
images/Aliens/Al_00_1.png \
images/Aliens/Al_00_16.png
d:\Qt\2010.01\qt\bin\rcc.exe -name images images.qrc -o debug\qrc_images.cpp
compiler_image_collection_make_all: qmake_image_collection.cpp
compiler_image_collection_clean:
-$(DEL_FILE) qmake_image_collection.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all: ui_mainwindow.h
compiler_uic_clean:
-$(DEL_FILE) ui_mainwindow.h
ui_mainwindow.h: mainwindow.ui
d:\Qt\2010.01\qt\bin\uic.exe mainwindow.ui -o ui_mainwindow.h
compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean
####### Compile
debug/main.o: main.cpp mainwindow.h \
aliens.h \
alien.h \
games.h \
basestruct.h \
map.h \
towers.h \
udpsender.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\main.o main.cpp
debug/mainwindow.o: mainwindow.cpp mainwindow.h \
aliens.h \
alien.h \
games.h \
basestruct.h \
map.h \
towers.h \
udpsender.h \
ui_mainwindow.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\mainwindow.o mainwindow.cpp
debug/adpainter.o: adpainter.cpp adpainter.h \
alien.h \
games.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\adpainter.o adpainter.cpp
debug/aliens.o: aliens.cpp aliens.h \
alien.h \
games.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\aliens.o aliens.cpp
debug/udpsender.o: udpsender.cpp udpsender.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\udpsender.o udpsender.cpp
debug/towers.o: towers.cpp towers.h \
games.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\towers.o towers.cpp
debug/map.o: map.cpp map.h \
games.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\map.o map.cpp
debug/games.o: games.cpp games.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\games.o games.cpp
debug/alien.o: alien.cpp alien.h \
games.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\alien.o alien.cpp
debug/moc_mainwindow.o: debug/moc_mainwindow.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\moc_mainwindow.o debug\moc_mainwindow.cpp
debug/moc_udpsender.o: debug/moc_udpsender.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\moc_udpsender.o debug\moc_udpsender.cpp
debug/qrc_images.o: debug/qrc_images.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\qrc_images.o debug\qrc_images.cpp
####### Install
install: FORCE
uninstall: FORCE
FORCE:

250
Makefile.Release Normal file
View File

@@ -0,0 +1,250 @@
#############################################################################
# Makefile for building: aliendefender
# Generated by qmake (2.01a) (Qt 4.6.1) on: ?? 7. ??? 19:16:37 2010
# Project: aliendefender.pro
# Template: app
#############################################################################
####### Compiler, tools and options
CC = gcc
CXX = g++
DEFINES = -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
CFLAGS = -O2 -Wall $(DEFINES)
CXXFLAGS = -O2 -frtti -fexceptions -mthreads -Wall $(DEFINES)
INCPATH = -I"d:\Qt\2010.01\qt\include\QtCore" -I"d:\Qt\2010.01\qt\include\QtNetwork" -I"d:\Qt\2010.01\qt\include\QtGui" -I"d:\Qt\2010.01\qt\include\QtOpenGL" -I"d:\Qt\2010.01\qt\include" -I"d:\Qt\2010.01\qt\include\ActiveQt" -I"release" -I"." -I"d:\Qt\2010.01\qt\mkspecs\win32-g++"
LINK = g++
LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows
LIBS = -L"d:\Qt\2010.01\qt\lib" -lopengl32 -lglu32 -lgdi32 -luser32 -lmingw32 -lqtmain -lQtOpenGL4 -lQtGui4 -lQtNetwork4 -lQtCore4
QMAKE = d:\qt\2010.01\qt\bin\qmake.exe
IDC = d:\Qt\2010.01\qt\bin\idc.exe
IDL = midl
ZIP = zip -r -9
DEF_FILE =
RES_FILE =
COPY = copy /y
COPY_FILE = $(COPY)
COPY_DIR = xcopy /s /q /y /i
DEL_FILE = del
DEL_DIR = rmdir
MOVE = move
CHK_DIR_EXISTS= if not exist
MKDIR = mkdir
INSTALL_FILE = $(COPY_FILE)
INSTALL_PROGRAM = $(COPY_FILE)
INSTALL_DIR = $(COPY_DIR)
####### Output directory
OBJECTS_DIR = release
####### Files
SOURCES = main.cpp \
mainwindow.cpp \
adpainter.cpp \
aliens.cpp \
udpsender.cpp \
towers.cpp \
map.cpp \
games.cpp \
alien.cpp release\moc_mainwindow.cpp \
release\moc_udpsender.cpp \
release\qrc_images.cpp
OBJECTS = release/main.o \
release/mainwindow.o \
release/adpainter.o \
release/aliens.o \
release/udpsender.o \
release/towers.o \
release/map.o \
release/games.o \
release/alien.o \
release/moc_mainwindow.o \
release/moc_udpsender.o \
release/qrc_images.o
DIST =
QMAKE_TARGET = aliendefender
DESTDIR = release\ #avoid trailing-slash linebreak
TARGET = aliendefender.exe
DESTDIR_TARGET = release\aliendefender.exe
####### Implicit rules
.SUFFIXES: .cpp .cc .cxx .c
.cpp.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.cc.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.cxx.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.c.o:
$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
####### Build rules
first: all
all: Makefile.Release $(DESTDIR_TARGET)
$(DESTDIR_TARGET): ui_mainwindow.h $(OBJECTS)
$(LINK) $(LFLAGS) -o $(DESTDIR_TARGET) object_script.aliendefender.Release $(LIBS)
qmake: FORCE
@$(QMAKE) -Wall -spec d:\Qt\2010.01\qt\mkspecs\win32-g++ -win32 -o Makefile.Release aliendefender.pro
dist:
$(ZIP) aliendefender.zip $(SOURCES) $(DIST) aliendefender.pro d:\Qt\2010.01\qt\mkspecs\qconfig.pri d:\Qt\2010.01\qt\mkspecs\features\qt_functions.prf d:\Qt\2010.01\qt\mkspecs\features\qt_config.prf d:\Qt\2010.01\qt\mkspecs\features\exclusive_builds.prf d:\Qt\2010.01\qt\mkspecs\features\default_pre.prf d:\Qt\2010.01\qt\mkspecs\features\win32\default_pre.prf d:\Qt\2010.01\qt\mkspecs\features\release.prf d:\Qt\2010.01\qt\mkspecs\features\debug_and_release.prf d:\Qt\2010.01\qt\mkspecs\features\default_post.prf d:\Qt\2010.01\qt\mkspecs\features\win32\default_post.prf d:\Qt\2010.01\qt\mkspecs\features\build_pass.prf d:\Qt\2010.01\qt\mkspecs\features\win32\rtti.prf d:\Qt\2010.01\qt\mkspecs\features\win32\exceptions.prf d:\Qt\2010.01\qt\mkspecs\features\win32\stl.prf d:\Qt\2010.01\qt\mkspecs\features\shared.prf d:\Qt\2010.01\qt\mkspecs\features\warn_on.prf d:\Qt\2010.01\qt\mkspecs\features\qt.prf d:\Qt\2010.01\qt\mkspecs\features\win32\opengl.prf d:\Qt\2010.01\qt\mkspecs\features\win32\thread.prf d:\Qt\2010.01\qt\mkspecs\features\moc.prf d:\Qt\2010.01\qt\mkspecs\features\win32\windows.prf d:\Qt\2010.01\qt\mkspecs\features\resources.prf d:\Qt\2010.01\qt\mkspecs\features\uic.prf d:\Qt\2010.01\qt\mkspecs\features\yacc.prf d:\Qt\2010.01\qt\mkspecs\features\lex.prf d:\Qt\2010.01\qt\mkspecs\features\include_source_dir.prf d:\Qt\2010.01\qt\lib\qtmain.prl HEADERS RESOURCES IMAGES SOURCES OBJECTIVE_SOURCES FORMS YACCSOURCES YACCSOURCES LEXSOURCES
clean: compiler_clean
-$(DEL_FILE) release\main.o release\mainwindow.o release\adpainter.o release\aliens.o release\udpsender.o release\towers.o release\map.o release\games.o release\alien.o release\moc_mainwindow.o release\moc_udpsender.o release\qrc_images.o
distclean: clean
-$(DEL_FILE) $(DESTDIR_TARGET)
-$(DEL_FILE) Makefile.Release
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: release/moc_mainwindow.cpp release/moc_udpsender.cpp
compiler_moc_header_clean:
-$(DEL_FILE) release\moc_mainwindow.cpp release\moc_udpsender.cpp
release/moc_mainwindow.cpp: aliens.h \
alien.h \
games.h \
basestruct.h \
map.h \
towers.h \
udpsender.h \
mainwindow.h
D:/Qt/2010.01/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 mainwindow.h -o release\moc_mainwindow.cpp
release/moc_udpsender.cpp: udpsender.h
D:/Qt/2010.01/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 udpsender.h -o release\moc_udpsender.cpp
compiler_rcc_make_all: release/qrc_images.cpp
compiler_rcc_clean:
-$(DEL_FILE) release\qrc_images.cpp
release/qrc_images.cpp: images.qrc \
images/Aliens/Al_00_12.png \
images/Aliens/Al_00_6.png \
images/Aliens/Al_00_2.png \
images/Aliens/Al_00_17.png \
images/Aliens/Al_00_13.png \
images/Aliens/Al_00_7.png \
images/Aliens/Al_00_3.png \
images/Aliens/Al_00_18.png \
images/Aliens/Al_00_10.png \
images/Aliens/Al_00_14.png \
images/Aliens/Al_00_8.png \
images/Aliens/Al_00_4.png \
images/Aliens/Al_00_0.png \
images/Aliens/Al_00_19.png \
images/Aliens/Al_00_11.png \
images/Aliens/Al_00_15.png \
images/Aliens/Al_00_9.png \
images/Aliens/Al_00_5.png \
images/Aliens/Al_00_1.png \
images/Aliens/Al_00_16.png
d:\Qt\2010.01\qt\bin\rcc.exe -name images images.qrc -o release\qrc_images.cpp
compiler_image_collection_make_all: qmake_image_collection.cpp
compiler_image_collection_clean:
-$(DEL_FILE) qmake_image_collection.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all: ui_mainwindow.h
compiler_uic_clean:
-$(DEL_FILE) ui_mainwindow.h
ui_mainwindow.h: mainwindow.ui
d:\Qt\2010.01\qt\bin\uic.exe mainwindow.ui -o ui_mainwindow.h
compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean
####### Compile
release/main.o: main.cpp mainwindow.h \
aliens.h \
alien.h \
games.h \
basestruct.h \
map.h \
towers.h \
udpsender.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\main.o main.cpp
release/mainwindow.o: mainwindow.cpp mainwindow.h \
aliens.h \
alien.h \
games.h \
basestruct.h \
map.h \
towers.h \
udpsender.h \
ui_mainwindow.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\mainwindow.o mainwindow.cpp
release/adpainter.o: adpainter.cpp adpainter.h \
alien.h \
games.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\adpainter.o adpainter.cpp
release/aliens.o: aliens.cpp aliens.h \
alien.h \
games.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\aliens.o aliens.cpp
release/udpsender.o: udpsender.cpp udpsender.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\udpsender.o udpsender.cpp
release/towers.o: towers.cpp towers.h \
games.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\towers.o towers.cpp
release/map.o: map.cpp map.h \
games.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\map.o map.cpp
release/games.o: games.cpp games.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\games.o games.cpp
release/alien.o: alien.cpp alien.h \
games.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\alien.o alien.cpp
release/moc_mainwindow.o: release/moc_mainwindow.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\moc_mainwindow.o release\moc_mainwindow.cpp
release/moc_udpsender.o: release/moc_udpsender.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\moc_udpsender.o release\moc_udpsender.cpp
release/qrc_images.o: release/qrc_images.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\qrc_images.o release\qrc_images.cpp
####### Install
install: FORCE
uninstall: FORCE
FORCE:

View File

@@ -5,9 +5,6 @@
#include <cmath> #include <cmath>
#include <QPainter>
#include <QBrush>
#include <QPen>
using std::atan; using std::atan;

View File

@@ -73,7 +73,7 @@ bool Alien::RecreatePath()
} }
void Alien::update() bool Alien::update()
{ {
float tmpdx,tmpdy,angl,arctg = 0; float tmpdx,tmpdy,angl,arctg = 0;
tmpdx = position.x() - path.at(PathIndex).x()*game->cellsize; tmpdx = position.x() - path.at(PathIndex).x()*game->cellsize;
@@ -81,11 +81,11 @@ void Alien::update()
while (std::sqrt(tmpdx*tmpdx +tmpdy*tmpdy) < 2*Speed*game->cellsize) while (std::sqrt(tmpdx*tmpdx +tmpdy*tmpdy) < 2*Speed*game->cellsize)
{ {
PathIndex++; PathIndex++;
if (PathIndex >= path.size()) if (PathIndex >= path.size()) return false;
{ /*{
PathIndex = 0; PathIndex = 0;
position = game->start*game->cellsize; position = game->start*game->cellsize;
} }*/
tmpdx = position.x() - path.at(PathIndex).x()*game->cellsize; tmpdx = position.x() - path.at(PathIndex).x()*game->cellsize;
tmpdy = position.y() - path.at(PathIndex).y()*game->cellsize; tmpdy = position.y() - path.at(PathIndex).y()*game->cellsize;
//qDebug() << "next"; //qDebug() << "next";
@@ -109,6 +109,7 @@ void Alien::update()
position.setY(position.y() position.setY(position.y()
-Speed*(float)game->cellsize*std::cos(arctg)); -Speed*(float)game->cellsize*std::cos(arctg));
PicIndex++; PicIndex++;
return true;
} }

View File

@@ -10,7 +10,7 @@ public:
bool RecreatePath(); bool RecreatePath();
//bool testTrace() {return (WaveTrace(data->start,data->finish) > 0);} //bool testTrace() {return (WaveTrace(data->start,data->finish) > 0);}
void setPos(QPointF pos) {position = pos;} void setPos(QPointF pos) {position = pos;}
void update(); bool update();
void resetIndexPic() {PicIndex = 0;} void resetIndexPic() {PicIndex = 0;}
QPointF Pos() const {return position;} QPointF Pos() const {return position;}
float Angl() const {return angle;} float Angl() const {return angle;}

View File

@@ -1,305 +1,347 @@
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<qtcreator> <qtcreator>
<data>
<variable>RunConfiguration0-BaseEnvironmentBase</variable>
<value type="int">2</value>
</data>
<data> <data>
<variable>RunConfiguration0-CommandLineArguments</variable> <variable>RunConfiguration0-CommandLineArguments</variable>
<valuelist type="QVariantList" /> <valuelist type="QVariantList"/>
</data> </data>
<data> <data>
<variable>RunConfiguration0-ProFile</variable> <variable>RunConfiguration0-ProFile</variable>
<value type="QString" >wavetrace.pro</value> <value type="QString">wavetrace.pro</value>
</data> </data>
<data> <data>
<variable>RunConfiguration0-RunConfiguration.name</variable> <variable>RunConfiguration0-RunConfiguration.name</variable>
<value type="QString" >aliendefender</value> <value type="QString">aliendefender</value>
</data> </data>
<data> <data>
<variable>RunConfiguration0-UseDyldImageSuffix</variable> <variable>RunConfiguration0-UseDyldImageSuffix</variable>
<value type="bool" >false</value> <value type="bool">false</value>
</data> </data>
<data> <data>
<variable>RunConfiguration0-UseTerminal</variable> <variable>RunConfiguration0-UseTerminal</variable>
<value type="bool" >false</value> <value type="bool">false</value>
</data> </data>
<data> <data>
<variable>RunConfiguration0-UserEnvironmentChanges</variable> <variable>RunConfiguration0-UserEnvironmentChanges</variable>
<valuelist type="QVariantList" /> <valuelist type="QVariantList"/>
</data> </data>
<data> <data>
<variable>RunConfiguration0-UserSetName</variable> <variable>RunConfiguration0-UserSetName</variable>
<value type="bool" >true</value> <value type="bool">true</value>
</data>
<data>
<variable>RunConfiguration0-UserSetWorkingDirectory</variable>
<value type="bool">false</value>
</data>
<data>
<variable>RunConfiguration0-UserWorkingDirectory</variable>
<value type="QString"></value>
</data> </data>
<data> <data>
<variable>RunConfiguration0-type</variable> <variable>RunConfiguration0-type</variable>
<value type="QString" >Qt4ProjectManager.Qt4RunConfiguration</value> <value type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
</data>
<data>
<variable>RunConfiguration1-BaseEnvironmentBase</variable>
<value type="int">2</value>
</data> </data>
<data> <data>
<variable>RunConfiguration1-CommandLineArguments</variable> <variable>RunConfiguration1-CommandLineArguments</variable>
<valuelist type="QVariantList" /> <valuelist type="QVariantList"/>
</data> </data>
<data> <data>
<variable>RunConfiguration1-ProFile</variable> <variable>RunConfiguration1-ProFile</variable>
<value type="QString" >aliendefender.pro</value> <value type="QString">aliendefender.pro</value>
</data> </data>
<data> <data>
<variable>RunConfiguration1-RunConfiguration.name</variable> <variable>RunConfiguration1-RunConfiguration.name</variable>
<value type="QString" >aliendefender</value> <value type="QString">aliendefender</value>
</data> </data>
<data> <data>
<variable>RunConfiguration1-UseDyldImageSuffix</variable> <variable>RunConfiguration1-UseDyldImageSuffix</variable>
<value type="bool" >false</value> <value type="bool">false</value>
</data> </data>
<data> <data>
<variable>RunConfiguration1-UseTerminal</variable> <variable>RunConfiguration1-UseTerminal</variable>
<value type="bool" >false</value> <value type="bool">false</value>
</data> </data>
<data> <data>
<variable>RunConfiguration1-UserEnvironmentChanges</variable> <variable>RunConfiguration1-UserEnvironmentChanges</variable>
<valuelist type="QVariantList" /> <valuelist type="QVariantList"/>
</data> </data>
<data> <data>
<variable>RunConfiguration1-UserSetName</variable> <variable>RunConfiguration1-UserSetName</variable>
<value type="bool" >false</value> <value type="bool">false</value>
</data>
<data>
<variable>RunConfiguration1-UserSetWorkingDirectory</variable>
<value type="bool">false</value>
</data>
<data>
<variable>RunConfiguration1-UserWorkingDirectory</variable>
<value type="QString"></value>
</data> </data>
<data> <data>
<variable>RunConfiguration1-type</variable> <variable>RunConfiguration1-type</variable>
<value type="QString" >Qt4ProjectManager.Qt4RunConfiguration</value> <value type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
</data> </data>
<data> <data>
<variable>activeRunConfiguration</variable> <variable>activeRunConfiguration</variable>
<value type="int" >1</value> <value type="int">1</value>
</data> </data>
<data> <data>
<variable>activebuildconfiguration</variable> <variable>activebuildconfiguration</variable>
<value type="QString" >Debug</value> <value type="QString">Debug</value>
</data> </data>
<data> <data>
<variable>buildConfiguration-Debug</variable> <variable>buildConfiguration-Debug</variable>
<valuemap type="QVariantMap" > <valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" >Debug</value> <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<value key="QtVersionId" type="int" >0</value> <value key="QtVersionId" type="int">0</value>
<value key="addQDumper" type="" ></value> <value key="ToolChain" type="int">2</value>
<value key="buildDirectory" type="QString" >/home/andrey/documents/sm11/Alien Defender/ad</value> <value key="addQDumper" type=""></value>
<value key="buildConfiguration" type="int">2</value>
<value key="buildDirectory" type="QString">/home/andrey/documents/sm11/Alien Defender/ad</value>
</valuemap> </valuemap>
</data> </data>
<data> <data>
<variable>buildConfiguration-Release</variable> <variable>buildConfiguration-Release</variable>
<valuemap type="QVariantMap" > <valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" >Release</value> <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
<value key="QtVersionId" type="int" >0</value> <value key="QtVersionId" type="int">0</value>
<value key="addQDumper" type="" ></value> <value key="ToolChain" type="int">2</value>
<value key="addQDumper" type=""></value>
<value key="buildConfiguration" type="int">0</value>
</valuemap> </valuemap>
</data> </data>
<data> <data>
<variable>buildconfiguration-Debug-buildstep0</variable> <variable>buildconfiguration-Debug-buildstep0</variable>
<valuemap type="QVariantMap" > <valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" >Debug</value> <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList" > <valuelist key="abstractProcess.Environment" type="QVariantList">
<value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-rwgGTf2llu,guid=47f9f0046990c9c4983a622a4b6c11df</value> <value type="QString">ALLUSERSPROFILE=C:\Documents and Settings\All Users</value>
<value type="QString" >DESKTOP_SESSION=gnome</value> <value type="QString">APPDATA=C:\Documents and Settings\Andrey\Application Data</value>
<value type="QString" >DESKTOP_STARTUP_ID=</value> <value type="QString">COMMONPROGRAMFILES=C:\Program Files\Common Files</value>
<value type="QString" >DISPLAY=:0.0</value> <value type="QString">COMPUTERNAME=COMP</value>
<value type="QString" >GDMSESSION=gnome</value> <value type="QString">COMSPEC=C:\WINDOWS\system32\cmd.exe</value>
<value type="QString" >GDM_KEYBOARD_LAYOUT=us</value> <value type="QString">FP_NO_HOST_CHECK=NO</value>
<value type="QString" >GDM_LANG=ru_RU.UTF-8</value> <value type="QString">HOMEDRIVE=C:</value>
<value type="QString" >GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value> <value type="QString">HOMEPATH=\Documents and Settings\Andrey</value>
<value type="QString" >GNOME_KEYRING_SOCKET=/tmp/keyring-cqyv3T/socket</value> <value type="QString">INCLUDE=C:\Program Files\Microsoft Visual Studio\VC98\atl\include;C:\Program Files\Microsoft Visual Studio\VC98\mfc\include;C:\Program Files\Microsoft Visual Studio\VC98\include</value>
<value type="QString" >GTK_MODULES=canberra-gtk-module</value> <value type="QString">LIB=C:\Program Files\Microsoft Visual Studio\VC98\mfc\lib;C:\Program Files\Microsoft Visual Studio\VC98\lib</value>
<value type="QString" >GTK_RC_FILES=/etc/gtk/gtkrc:/home/andrey/.gtkrc-1.2-gnome2</value> <value type="QString">LOGONSERVER=\\COMP</value>
<value type="QString" >HOME=/home/andrey</value> <value type="QString">MSDEVDIR=C:\Program Files\Microsoft Visual Studio\Common\MSDev98</value>
<value type="QString" >LANG=ru_RU.UTF-8</value> <value type="QString">NUMBER_OF_PROCESSORS=2</value>
<value type="QString" >LANGUAGE=</value> <value type="QString">OS=Windows_NT</value>
<value type="QString" >LD_LIBRARY_PATH=/usr/lib/qtcreator:</value> <value type="QString">PATH=D:\Qt\2010.01\mingw\bin;D:\Qt\2010.01\qt\bin;C:\Program Files\PC Connectivity Solution\;C:\Program Files\JavaFX\javafx-sdk1.2\bin;C:\Program Files\JavaFX\javafx-sdk1.2\emulator\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\IVI Foundation\VISA\WinNT\Bin;C:\Program Files\Borland\Delphi7\Bin;C:\Program Files\Borland\Delphi7\Projects\Bpl;C:\Program Files\Git\cmd;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin;C:\Program Files\OpenVPN\bin</value>
<value type="QString" >LOGNAME=andrey</value> <value type="QString">PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH</value>
<value type="QString" >ORBIT_SOCKETDIR=/tmp/orbit-andrey</value> <value type="QString">PROCESSOR_ARCHITECTURE=x86</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">PROCESSOR_IDENTIFIER=x86 Family 6 Model 23 Stepping 6, GenuineIntel</value>
<value type="QString" >PWD=/home/andrey</value> <value type="QString">PROCESSOR_LEVEL=6</value>
<value type="QString" >QTDIR=/usr</value> <value type="QString">PROCESSOR_REVISION=1706</value>
<value type="QString" >SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1283,unix/buull-eeePC:/tmp/.ICE-unix/1283</value> <value type="QString">PROGRAMFILES=C:\Program Files</value>
<value type="QString" >SHELL=/bin/bash</value> <value type="QString">QTDIR=D:/Qt/2010.01/qt</value>
<value type="QString" >SPEECHD_PORT=7560</value> <value type="QString">SESSIONNAME=Console</value>
<value type="QString" >SSH_AGENT_PID=1356</value> <value type="QString">SYSTEMDRIVE=C:</value>
<value type="QString" >SSH_AUTH_SOCK=/tmp/keyring-cqyv3T/socket.ssh</value> <value type="QString">SYSTEMROOT=C:\WINDOWS</value>
<value type="QString" >USER=andrey</value> <value type="QString">TEMP=C:\DOCUME~1\Andrey\LOCALS~1\Temp</value>
<value type="QString" >USERNAME=andrey</value> <value type="QString">TMP=C:\DOCUME~1\Andrey\LOCALS~1\Temp</value>
<value type="QString" >XAUTHORITY=/var/run/gdm/auth-for-andrey-FKbzYa/database</value> <value type="QString">USERDOMAIN=COMP</value>
<value type="QString" >XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value> <value type="QString">USERNAME=Andrey</value>
<value type="QString" >XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1265373654.150132-179730100</value> <value type="QString">USERPROFILE=C:\Documents and Settings\Andrey</value>
<value type="QString">VS90COMNTOOLS=D:\Programming\Microsoft Visual Studio 9.0\Common7\Tools\</value>
<value type="QString">VXIPNPPATH=C:\Program Files\IVI Foundation\VISA\</value>
<value type="QString">WINDIR=C:\WINDOWS</value>
</valuelist> </valuelist>
<valuelist key="abstractProcess.arguments" type="QVariantList" > <valuelist key="abstractProcess.arguments" type="QVariantList">
<value type="QString" >/home/andrey/projects/aliendefender/aliendefender.pro</value> <value type="QString">C:/aliendefender/aliendefender.pro</value>
<value type="QString" >-spec</value> <value type="QString">-spec</value>
<value type="QString" >/usr/share/qt4/mkspecs/linux-g++</value> <value type="QString">win32-g++</value>
<value type="QString" >-r</value> <value type="QString">-r</value>
<value type="QString" >CONFIG+=debug</value> <value type="QString">-Wall</value>
<value type="QString" >-Wall</value>
</valuelist> </valuelist>
<value key="abstractProcess.command" type="QString" >/usr/bin/qmake-qt4</value> <value key="abstractProcess.command" type="QString">d:/qt/2010.01/qt/bin/qmake.exe</value>
<value key="abstractProcess.enabled" type="bool" >false</value> <value key="abstractProcess.enabled" type="bool">true</value>
<value key="abstractProcess.workingDirectory" type="QString" >/home/andrey/projects/aliendefender</value> <value key="abstractProcess.workingDirectory" type="QString">C:/aliendefender</value>
<value key="buildConfiguration" type="int" >2</value> <value key="buildConfiguration" type=""></value>
<valuelist key="qmakeArgs" type="QVariantList" > <valuelist key="qmakeArgs" type="QVariantList">
<value type="QString" >-Wall</value> <value type="QString">-Wall</value>
</valuelist> </valuelist>
</valuemap> </valuemap>
</data> </data>
<data> <data>
<variable>buildconfiguration-Debug-buildstep1</variable> <variable>buildconfiguration-Debug-buildstep1</variable>
<valuemap type="QVariantMap" > <valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" >Debug</value> <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList" > <valuelist key="abstractProcess.Environment" type="QVariantList">
<value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-rwgGTf2llu,guid=47f9f0046990c9c4983a622a4b6c11df</value> <value type="QString">ALLUSERSPROFILE=C:\Documents and Settings\All Users</value>
<value type="QString" >DESKTOP_SESSION=gnome</value> <value type="QString">APPDATA=C:\Documents and Settings\Andrey\Application Data</value>
<value type="QString" >DESKTOP_STARTUP_ID=</value> <value type="QString">COMMONPROGRAMFILES=C:\Program Files\Common Files</value>
<value type="QString" >DISPLAY=:0.0</value> <value type="QString">COMPUTERNAME=COMP</value>
<value type="QString" >GDMSESSION=gnome</value> <value type="QString">COMSPEC=C:\WINDOWS\system32\cmd.exe</value>
<value type="QString" >GDM_KEYBOARD_LAYOUT=us</value> <value type="QString">FP_NO_HOST_CHECK=NO</value>
<value type="QString" >GDM_LANG=ru_RU.UTF-8</value> <value type="QString">HOMEDRIVE=C:</value>
<value type="QString" >GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value> <value type="QString">HOMEPATH=\Documents and Settings\Andrey</value>
<value type="QString" >GNOME_KEYRING_SOCKET=/tmp/keyring-cqyv3T/socket</value> <value type="QString">INCLUDE=C:\Program Files\Microsoft Visual Studio\VC98\atl\include;C:\Program Files\Microsoft Visual Studio\VC98\mfc\include;C:\Program Files\Microsoft Visual Studio\VC98\include</value>
<value type="QString" >GTK_MODULES=canberra-gtk-module</value> <value type="QString">LIB=C:\Program Files\Microsoft Visual Studio\VC98\mfc\lib;C:\Program Files\Microsoft Visual Studio\VC98\lib</value>
<value type="QString" >GTK_RC_FILES=/etc/gtk/gtkrc:/home/andrey/.gtkrc-1.2-gnome2</value> <value type="QString">LOGONSERVER=\\COMP</value>
<value type="QString" >HOME=/home/andrey</value> <value type="QString">MSDEVDIR=C:\Program Files\Microsoft Visual Studio\Common\MSDev98</value>
<value type="QString" >LANG=ru_RU.UTF-8</value> <value type="QString">NUMBER_OF_PROCESSORS=2</value>
<value type="QString" >LANGUAGE=</value> <value type="QString">OS=Windows_NT</value>
<value type="QString" >LD_LIBRARY_PATH=/usr/lib/qtcreator:</value> <value type="QString">PATH=D:\Qt\2010.01\mingw\bin;D:\Qt\2010.01\qt\bin;C:\Program Files\PC Connectivity Solution\;C:\Program Files\JavaFX\javafx-sdk1.2\bin;C:\Program Files\JavaFX\javafx-sdk1.2\emulator\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\IVI Foundation\VISA\WinNT\Bin;C:\Program Files\Borland\Delphi7\Bin;C:\Program Files\Borland\Delphi7\Projects\Bpl;C:\Program Files\Git\cmd;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin;C:\Program Files\OpenVPN\bin</value>
<value type="QString" >LOGNAME=andrey</value> <value type="QString">PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH</value>
<value type="QString" >ORBIT_SOCKETDIR=/tmp/orbit-andrey</value> <value type="QString">PROCESSOR_ARCHITECTURE=x86</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">PROCESSOR_IDENTIFIER=x86 Family 6 Model 23 Stepping 6, GenuineIntel</value>
<value type="QString" >PWD=/home/andrey</value> <value type="QString">PROCESSOR_LEVEL=6</value>
<value type="QString" >QTDIR=/usr</value> <value type="QString">PROCESSOR_REVISION=1706</value>
<value type="QString" >SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1283,unix/buull-eeePC:/tmp/.ICE-unix/1283</value> <value type="QString">PROGRAMFILES=C:\Program Files</value>
<value type="QString" >SHELL=/bin/bash</value> <value type="QString">QTDIR=D:/Qt/2010.01/qt</value>
<value type="QString" >SPEECHD_PORT=7560</value> <value type="QString">SESSIONNAME=Console</value>
<value type="QString" >SSH_AGENT_PID=1356</value> <value type="QString">SYSTEMDRIVE=C:</value>
<value type="QString" >SSH_AUTH_SOCK=/tmp/keyring-cqyv3T/socket.ssh</value> <value type="QString">SYSTEMROOT=C:\WINDOWS</value>
<value type="QString" >USER=andrey</value> <value type="QString">TEMP=C:\DOCUME~1\Andrey\LOCALS~1\Temp</value>
<value type="QString" >USERNAME=andrey</value> <value type="QString">TMP=C:\DOCUME~1\Andrey\LOCALS~1\Temp</value>
<value type="QString" >XAUTHORITY=/var/run/gdm/auth-for-andrey-FKbzYa/database</value> <value type="QString">USERDOMAIN=COMP</value>
<value type="QString" >XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value> <value type="QString">USERNAME=Andrey</value>
<value type="QString" >XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1265373654.150132-179730100</value> <value type="QString">USERPROFILE=C:\Documents and Settings\Andrey</value>
<value type="QString">VS90COMNTOOLS=D:\Programming\Microsoft Visual Studio 9.0\Common7\Tools\</value>
<value type="QString">VXIPNPPATH=C:\Program Files\IVI Foundation\VISA\</value>
<value type="QString">WINDIR=C:\WINDOWS</value>
</valuelist> </valuelist>
<valuelist key="abstractProcess.arguments" type="QVariantList" > <value key="abstractProcess.IgnoreReturnValue" type="bool">false</value>
<value type="QString" >-j3</value> <valuelist key="abstractProcess.arguments" type="QVariantList">
<value type="QString" >-w</value> <value type="QString">-j3</value>
<value type="QString">-w</value>
</valuelist> </valuelist>
<value key="abstractProcess.command" type="QString" >/usr/bin/make</value> <value key="abstractProcess.command" type="QString">D:/Qt/2010.01/mingw/bin/mingw32-make.exe</value>
<value key="abstractProcess.enabled" type="bool" >true</value> <value key="abstractProcess.enabled" type="bool">true</value>
<value key="abstractProcess.workingDirectory" type="QString" >/home/andrey/projects/aliendefender</value> <value key="abstractProcess.workingDirectory" type="QString">C:/aliendefender</value>
<valuelist key="makeargs" type="QVariantList" > <valuelist key="makeargs" type="QVariantList">
<value type="QString" >-j3</value> <value type="QString">-j3</value>
</valuelist> </valuelist>
</valuemap> </valuemap>
</data> </data>
<data> <data>
<variable>buildconfiguration-Debug-cleanstep0</variable> <variable>buildconfiguration-Debug-cleanstep0</variable>
<valuemap type="QVariantMap" > <valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" >Debug</value> <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList" > <valuelist key="abstractProcess.Environment" type="QVariantList">
<value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-rwgGTf2llu,guid=47f9f0046990c9c4983a622a4b6c11df</value> <value type="QString">ALLUSERSPROFILE=C:\Documents and Settings\All Users</value>
<value type="QString" >DESKTOP_SESSION=gnome</value> <value type="QString">APPDATA=C:\Documents and Settings\Andrey\Application Data</value>
<value type="QString" >DESKTOP_STARTUP_ID=</value> <value type="QString">COMMONPROGRAMFILES=C:\Program Files\Common Files</value>
<value type="QString" >DISPLAY=:0.0</value> <value type="QString">COMPUTERNAME=COMP</value>
<value type="QString" >GDMSESSION=gnome</value> <value type="QString">COMSPEC=C:\WINDOWS\system32\cmd.exe</value>
<value type="QString" >GDM_KEYBOARD_LAYOUT=us</value> <value type="QString">FP_NO_HOST_CHECK=NO</value>
<value type="QString" >GDM_LANG=ru_RU.UTF-8</value> <value type="QString">HOMEDRIVE=C:</value>
<value type="QString" >GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value> <value type="QString">HOMEPATH=\Documents and Settings\Andrey</value>
<value type="QString" >GNOME_KEYRING_SOCKET=/tmp/keyring-cqyv3T/socket</value> <value type="QString">INCLUDE=C:\Program Files\Microsoft Visual Studio\VC98\atl\include;C:\Program Files\Microsoft Visual Studio\VC98\mfc\include;C:\Program Files\Microsoft Visual Studio\VC98\include</value>
<value type="QString" >GTK_MODULES=canberra-gtk-module</value> <value type="QString">LIB=C:\Program Files\Microsoft Visual Studio\VC98\mfc\lib;C:\Program Files\Microsoft Visual Studio\VC98\lib</value>
<value type="QString" >GTK_RC_FILES=/etc/gtk/gtkrc:/home/andrey/.gtkrc-1.2-gnome2</value> <value type="QString">LOGONSERVER=\\COMP</value>
<value type="QString" >HOME=/home/andrey</value> <value type="QString">MSDEVDIR=C:\Program Files\Microsoft Visual Studio\Common\MSDev98</value>
<value type="QString" >LANG=ru_RU.UTF-8</value> <value type="QString">NUMBER_OF_PROCESSORS=2</value>
<value type="QString" >LANGUAGE=</value> <value type="QString">OS=Windows_NT</value>
<value type="QString" >LD_LIBRARY_PATH=/usr/lib/qtcreator:</value> <value type="QString">PATH=D:\Qt\2010.01\mingw\bin;D:\Qt\2010.01\qt\bin;C:\Program Files\PC Connectivity Solution\;C:\Program Files\JavaFX\javafx-sdk1.2\bin;C:\Program Files\JavaFX\javafx-sdk1.2\emulator\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\IVI Foundation\VISA\WinNT\Bin;C:\Program Files\Borland\Delphi7\Bin;C:\Program Files\Borland\Delphi7\Projects\Bpl;C:\Program Files\Git\cmd;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin;C:\Program Files\OpenVPN\bin</value>
<value type="QString" >LOGNAME=andrey</value> <value type="QString">PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH</value>
<value type="QString" >ORBIT_SOCKETDIR=/tmp/orbit-andrey</value> <value type="QString">PROCESSOR_ARCHITECTURE=x86</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">PROCESSOR_IDENTIFIER=x86 Family 6 Model 23 Stepping 6, GenuineIntel</value>
<value type="QString" >PWD=/home/andrey</value> <value type="QString">PROCESSOR_LEVEL=6</value>
<value type="QString" >QTDIR=/usr</value> <value type="QString">PROCESSOR_REVISION=1706</value>
<value type="QString" >SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1283,unix/buull-eeePC:/tmp/.ICE-unix/1283</value> <value type="QString">PROGRAMFILES=C:\Program Files</value>
<value type="QString" >SHELL=/bin/bash</value> <value type="QString">QTDIR=D:/Qt/2010.01/qt</value>
<value type="QString" >SPEECHD_PORT=7560</value> <value type="QString">SESSIONNAME=Console</value>
<value type="QString" >SSH_AGENT_PID=1356</value> <value type="QString">SYSTEMDRIVE=C:</value>
<value type="QString" >SSH_AUTH_SOCK=/tmp/keyring-cqyv3T/socket.ssh</value> <value type="QString">SYSTEMROOT=C:\WINDOWS</value>
<value type="QString" >USER=andrey</value> <value type="QString">TEMP=C:\DOCUME~1\Andrey\LOCALS~1\Temp</value>
<value type="QString" >USERNAME=andrey</value> <value type="QString">TMP=C:\DOCUME~1\Andrey\LOCALS~1\Temp</value>
<value type="QString" >XAUTHORITY=/var/run/gdm/auth-for-andrey-FKbzYa/database</value> <value type="QString">USERDOMAIN=COMP</value>
<value type="QString" >XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value> <value type="QString">USERNAME=Andrey</value>
<value type="QString" >XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1265373654.150132-179730100</value> <value type="QString">USERPROFILE=C:\Documents and Settings\Andrey</value>
<value type="QString">VS90COMNTOOLS=D:\Programming\Microsoft Visual Studio 9.0\Common7\Tools\</value>
<value type="QString">VXIPNPPATH=C:\Program Files\IVI Foundation\VISA\</value>
<value type="QString">WINDIR=C:\WINDOWS</value>
</valuelist> </valuelist>
<valuelist key="abstractProcess.arguments" type="QVariantList" > <value key="abstractProcess.IgnoreReturnValue" type="bool">true</value>
<value type="QString" >clean</value> <valuelist key="abstractProcess.arguments" type="QVariantList">
<value type="QString" >-w</value> <value type="QString">clean</value>
<value type="QString">-w</value>
</valuelist>
<value key="abstractProcess.command" type="QString">D:/Qt/2010.01/mingw/bin/mingw32-make.exe</value>
<value key="abstractProcess.enabled" type="bool">true</value>
<value key="abstractProcess.workingDirectory" type="QString">C:/aliendefender</value>
<value key="cleanConfig" type="bool">true</value>
<valuelist key="makeargs" type="QVariantList">
<value type="QString">clean</value>
</valuelist> </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/projects/aliendefender</value>
</valuemap> </valuemap>
</data> </data>
<data> <data>
<variable>buildconfiguration-Release-buildstep0</variable> <variable>buildconfiguration-Release-buildstep0</variable>
<valuemap type="QVariantMap" > <valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" >Release</value> <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
<value key="buildConfiguration" type="int" >0</value> <value key="buildConfiguration" type=""></value>
</valuemap> </valuemap>
</data> </data>
<data> <data>
<variable>buildconfiguration-Release-buildstep1</variable> <variable>buildconfiguration-Release-buildstep1</variable>
<valuemap type="QVariantMap" > <valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" >Release</value> <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
</valuemap> </valuemap>
</data> </data>
<data> <data>
<variable>buildconfiguration-Release-cleanstep0</variable> <variable>buildconfiguration-Release-cleanstep0</variable>
<valuemap type="QVariantMap" > <valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" >Release</value> <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
</valuemap> </valuemap>
</data> </data>
<data> <data>
<variable>buildconfigurations</variable> <variable>buildconfigurations</variable>
<valuelist type="QVariantList" > <valuelist type="QVariantList">
<value type="QString" >Debug</value> <value type="QString">Debug</value>
<value type="QString" >Release</value> <value type="QString">Release</value>
</valuelist> </valuelist>
</data> </data>
<data> <data>
<variable>buildstep0</variable> <variable>buildstep0</variable>
<valuemap type="QVariantMap" > <valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" ></value> <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
<value key="mkspec" type="QString" ></value> <value key="mkspec" type="QString"></value>
</valuemap> </valuemap>
</data> </data>
<data> <data>
<variable>buildstep1</variable> <variable>buildstep1</variable>
<valuemap type="QVariantMap" > <valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" ></value> <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
</valuemap> </valuemap>
</data> </data>
<data> <data>
<variable>buildsteps</variable> <variable>buildsteps</variable>
<valuelist type="QVariantList" > <valuelist type="QVariantList">
<value type="QString" >trolltech.qt4projectmanager.qmake</value> <value type="QString">trolltech.qt4projectmanager.qmake</value>
<value type="QString" >trolltech.qt4projectmanager.make</value> <value type="QString">trolltech.qt4projectmanager.make</value>
</valuelist> </valuelist>
</data> </data>
<data> <data>
<variable>cleanstep0</variable> <variable>cleanstep0</variable>
<valuemap type="QVariantMap" > <valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" ></value> <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
<value key="clean" type="bool" >true</value> <value key="clean" type="bool">true</value>
</valuemap> </valuemap>
</data> </data>
<data> <data>
<variable>cleansteps</variable> <variable>cleansteps</variable>
<valuelist type="QVariantList" > <valuelist type="QVariantList">
<value type="QString" >trolltech.qt4projectmanager.make</value> <value type="QString">trolltech.qt4projectmanager.make</value>
</valuelist> </valuelist>
</data> </data>
<data> <data>
<variable>defaultFileEncoding</variable> <variable>defaultFileEncoding</variable>
<value type="QByteArray" >UTF-8</value> <value type="QByteArray">UTF-8</value>
</data> </data>
<data> <data>
<variable>project</variable> <variable>project</variable>
<valuemap type="QVariantMap" /> <valuemap type="QVariantMap"/>
</data> </data>
</qtcreator> </qtcreator>

View File

@@ -3,17 +3,88 @@
Aliens::Aliens(games *parent) Aliens::Aliens(games *parent)
{ {
game = parent; game = parent;
int x = loadPixmaps();
if (x > 0) qDebug() << "Found" << x << "alien pictures";
else qDebug() << "ERROR alien pictures not found!!";
testAlien = new Alien(game);
} }
bool Aliens::AddAlien() bool Aliens::AddAlien()
{ {
curAliens.push_back(new Alien(game,0.1)); curAliens.push_back(new Alien(game,0.2));
return !curAliens.isEmpty(); return !curAliens.isEmpty();
} }
/*
void Aliens::clearAliens() void Aliens::clearAliens()
{ {
curAliens.clear(); curAliens.clear();
} }
*/
bool Aliens::retrace()
{
if (!testAlien->RecreatePath()) return false;
for (int i=0; i < curAliens.size(); i ++)
if (!curAliens.at(i)->RecreatePath()) return false;
return true;
}
int Aliens::loadPixmaps()
{
QString str;
QPixmap tmpAlPixmap;
int i=1;
str.setNum(i);
while (i != 0) {
str.setNum(i);
tmpAlPixmap.load(":/aliens/images/Aliens/Al_00_" + str + ".png");
if (!tmpAlPixmap.isNull()) {
AlienPix.push_back(tmpAlPixmap);
tmpAlPixmap = 0;
i++;
}
else i = 0;
}
return AlienPix.size();
}
void Aliens::drawAliens()
{
for (int i=0; i < curAliens.size(); i ++)
{
if (!curAliens.at(i)->update()) DelAlien(i);
else if (curAliens.at(i)->indexPix() >= AlienPix.size()) curAliens.at(i)->resetIndexPic();
}
QPainter painter(game->buff);
QPen pen(QColor(80,200,100));
QBrush brush(QColor(230,10,10),Qt::SolidPattern);
painter.setPen(pen);
painter.setBrush(brush);
painter.drawPixmap(0,0,*game->background);
for (int i=0; i < curAliens.size(); i ++)
{
for (int j = 0; j < curAliens.at(i)->path.size(); j++)
painter.drawEllipse(curAliens.at(i)->path.at(j).x()*game->cellsize +4,
curAliens.at(i)->path.at(j).y()*game->cellsize +4,
game->cellsize - 8,
game->cellsize - 8);
painter.save();
painter.translate(curAliens.at(i)->Pos().x()+game->cellsize/2, curAliens.at(i)->Pos().y()+game->cellsize/2);
painter.rotate(curAliens.at(i)->Angl());
painter.drawPixmap(-game->cellsize, -game->cellsize, game->cellsize*2, game->cellsize*2,
AlienPix[curAliens.at(i)->indexPix()]);
painter.restore();
}
painter.end();
}
void Aliens::DelAlien(int index)
{
curAliens.remove(index);
}

View File

@@ -8,12 +8,20 @@ class Aliens
public: public:
Aliens(games *parent); Aliens(games *parent);
bool AddAlien(); bool AddAlien();
void clearAliens(); void DelAlien(int index);
void drawAliens();
bool retrace();
int size() const {return curAliens.size();}
//void clearAliens();
Alien * alienAt(int index) const {return curAliens.at(index);} Alien * alienAt(int index) const {return curAliens.at(index);}
private: private:
games * game; games * game;
Alien * testAlien;
QVector<Alien*> srcAliens; QVector<Alien*> srcAliens;
QVector<Alien*> curAliens; QVector<Alien*> curAliens;
QVector<QPixmap> AlienPix;
int loadPixmaps();
}; };
#endif // ALIENS_H #endif // ALIENS_H

View File

@@ -8,6 +8,9 @@
#include <QRect> #include <QRect>
#include <QSize> #include <QSize>
#include <QDebug> #include <QDebug>
#include <QPainter>
#include <QBrush>
#include <QPen>
/* /*

BIN
debug/aliendefender.exe Normal file

Binary file not shown.

View File

@@ -9,29 +9,30 @@ MainWindow::MainWindow(QWidget *parent)
ui->setupUi(this); ui->setupUi(this);
//sndr = new UdpSender("127.0.0.1",10101); //sndr = new UdpSender("127.0.0.1",10101);
//sndr->connectSend("hellow"); //sndr->connectSend("hellow");
cellsize = 16; int cellsize = 16;
destx = this->width() / cellsize;
desty = this->height() / cellsize / 2;
timer = new QTimer(this); timer = new QTimer(this);
adp = new adpainter(this->width(),this->height(),cellsize); //adp = new adpainter(this->width(),this->height(),cellsize);
adp->clear(); //adp->clear();
adp->drawgrid(); //adp->drawgrid();
connect(timer, SIGNAL(timeout()), this, SLOT(ADrender())); connect(timer, SIGNAL(timeout()), this, SLOT(ADrender()));
GameMain = new games(this->size(),QPoint(0,this->height()/2),QPoint(this->width()-cellsize,this->height()/2), cellsize); GameMain = new games(this->size(),QPoint(0,this->height()/2),QPoint(this->width()-cellsize,this->height()/2), cellsize);
aliens = new Aliens(GameMain); maliens = new Aliens(GameMain);
aliens->AddAlien(); maliens->AddAlien();
mmap = new map(GameMain);
mmap->clear();
mmap->drawgrid();
mtowers = new towers(GameMain);
this->setGeometry(100,100,this->width(),this->height()); this->setGeometry(100,100,this->width(),this->height());
//qDebug() << "QT version" << qVersion();
//AnimAlien = 0;
timer->start(50); timer->start(50);
qDebug() << "Load DONE!";
mousebt = 0; mousebt = 0;
qDebug() << "Load DONE!";
} }
void MainWindow::ADrender() void MainWindow::ADrender()
{ {
adp->drawAlien(aliens->alienAt(0)); //adp->drawAlien(aliens->alienAt(0));
maliens->drawAliens();
this->repaint(); this->repaint();
} }
@@ -40,7 +41,7 @@ void MainWindow::paintEvent(QPaintEvent*)
{ {
QPainter painter; QPainter painter;
painter.begin(this); painter.begin(this);
painter.drawPixmap(0,0,*adp->getPixmap()); painter.drawPixmap(0,0,*GameMain->buff);
painter.end(); painter.end();
} }
@@ -70,19 +71,18 @@ void MainWindow::mousePressEvent (QMouseEvent *event)
void MainWindow::SetCell(QPoint pos) void MainWindow::SetCell(QPoint pos)
{ {
bool trace = false;
QPoint cp; QPoint cp;
QRect wdrect(0, 0, (this->width() / cellsize) * cellsize, (this->height() / cellsize) * cellsize); QRect wdrect(0, 0, (this->width()/GameMain->cellsize)*GameMain->cellsize,
(this->height()/GameMain->cellsize)*GameMain->cellsize);
if (wdrect.contains(pos)) { if (wdrect.contains(pos)) {
cp.setX(pos.x()/cellsize); cp.setX(pos.x()/GameMain->cellsize);
cp.setY(pos.y()/cellsize); cp.setY(pos.y()/GameMain->cellsize);
//qDebug() << "click: " << cp.x() << ";" << cp.y(); mtowers->drawcell(cp);
if (GameMain->Cells[cp.x()][cp.y()] == 1) trace = true;
GameMain->Cells[cp.x()][cp.y()] = - 1; GameMain->Cells[cp.x()][cp.y()] = - 1;
adp->drawcell(cp); if (trace)
//aliens->clearAliens(); if (!maliens->retrace()) ClearCell(pos);
//adp->StepAlien=0;
//adp->AnimAlien=0;
if (!aliens->alienAt(0)->RecreatePath()) ClearCell(pos);
else adp->StepAlien=0;
} }
} }
@@ -90,17 +90,14 @@ void MainWindow::SetCell(QPoint pos)
void MainWindow::ClearCell(QPoint pos) void MainWindow::ClearCell(QPoint pos)
{ {
QPoint cp; QPoint cp;
QRect wdrect(0, 0, (this->width() / cellsize) * cellsize, (this->height() / cellsize) * cellsize); QRect wdrect(0, 0, (this->width()/GameMain->cellsize)*GameMain->cellsize,
(this->height()/GameMain->cellsize)*GameMain->cellsize);
if (wdrect.contains(pos)) { if (wdrect.contains(pos)) {
cp.setX(pos.x()/cellsize); cp.setX(pos.x()/GameMain->cellsize);
cp.setY(pos.y()/cellsize); cp.setY(pos.y()/GameMain->cellsize);
//qDebug() << "click: " << cp.x() << ";" << cp.y();
GameMain->Cells[cp.x()][cp.y()] = 0; GameMain->Cells[cp.x()][cp.y()] = 0;
adp->clearcell(cp); mtowers->clearcell(cp);
//aliens->clearAliens(); maliens->retrace();
//aliens->AddAlien();
aliens->alienAt(0)->RecreatePath();
adp->StepAlien=0;
} }
} }
@@ -109,8 +106,11 @@ void MainWindow::keyPressEvent(QKeyEvent * e)
{ {
qDebug() << e->key(); qDebug() << e->key();
switch(e->key()) { switch(e->key()) {
case 69: case 65:
aliens->AddAlien(); maliens->AddAlien();
break;
case 68:
if (maliens->size() > 0) maliens->DelAlien(maliens->size()-1);
break; break;
} }
} }
@@ -119,6 +119,9 @@ void MainWindow::keyPressEvent(QKeyEvent * e)
MainWindow::~MainWindow() MainWindow::~MainWindow()
{ {
delete ui; delete ui;
delete aliens; delete mtowers;
delete adp; delete mmap;
delete maliens;
delete GameMain;
//delete adp;
} }

View File

@@ -5,8 +5,10 @@
#include <QTimer> #include <QTimer>
#include <QMouseEvent> #include <QMouseEvent>
#include <QKeyEvent> #include <QKeyEvent>
#include "adpainter.h" //#include "adpainter.h"
#include "aliens.h" #include "aliens.h"
#include "map.h"
#include "towers.h"
#include "udpsender.h" #include "udpsender.h"
namespace Ui namespace Ui
@@ -32,14 +34,14 @@ private:
void mousePressEvent(QMouseEvent *e); void mousePressEvent(QMouseEvent *e);
void keyPressEvent(QKeyEvent *e); void keyPressEvent(QKeyEvent *e);
Ui::MainWindow *ui; Ui::MainWindow *ui;
Aliens * aliens; Aliens * maliens;
map * mmap;
towers * mtowers;
//UdpSender * sndr; //UdpSender * sndr;
adpainter * adp; //adpainter * adp;
games * GameMain; games * GameMain;
QTimer *timer; QTimer *timer;
int mousebt; int mousebt;
int cellsize, destx, desty;
//unsigned int AnimAlien;
}; };

25
map.cpp
View File

@@ -3,4 +3,29 @@
map::map(games *parent) map::map(games *parent)
{ {
game = parent;
}
void map::clear()
{
QPainter painter(game->background);
QPen pen(QColor(150,150,150));
painter.setPen(pen);
painter.fillRect(game->background->rect(),QColor(150,150,150));
painter.end();
}
void map::drawgrid()
{
int i;
QPainter painter(game->background);
QPen pen(QColor(100,100,100));
painter.setPen(pen);
for (i = 0; i < game->background->width()/game->cellsize; i++)
painter.drawLine(i*game->cellsize,0,i*game->cellsize,game->background->height());
for (i = 0; i < game->background->height()/game->cellsize; i++)
painter.drawLine(0,i*game->cellsize,game->background->width(),i*game->cellsize);
painter.end();
} }

5
map.h
View File

@@ -7,7 +7,10 @@ class map
{ {
public: public:
map(games *parent); map(games *parent);
QPixmap * background; void clear();
void drawgrid();
private:
games * game;
}; };
#endif // MAP_H #endif // MAP_H

View File

@@ -0,0 +1,14 @@
INPUT(
./debug\main.o
./debug\mainwindow.o
./debug\adpainter.o
./debug\aliens.o
./debug\udpsender.o
./debug\towers.o
./debug\map.o
./debug\games.o
./debug\alien.o
./debug\moc_mainwindow.o
./debug\moc_udpsender.o
./debug\qrc_images.o
);

View File

@@ -0,0 +1,14 @@
INPUT(
./release\main.o
./release\mainwindow.o
./release\adpainter.o
./release\aliens.o
./release\udpsender.o
./release\towers.o
./release\map.o
./release\games.o
./release\alien.o
./release\moc_mainwindow.o
./release\moc_udpsender.o
./release\qrc_images.o
);

View File

@@ -2,10 +2,36 @@
towers::towers(games *parent) towers::towers(games *parent)
{ {
game = parent;
} }
void towers::drawcell(QPoint pnt)
{
QPainter painter(game->background);
QPen pen(QColor(0,0,0));
QBrush brush(QColor(0,0,0),Qt::SolidPattern);
painter.setPen(pen);
painter.setBrush(brush);
painter.drawRect(pnt.x()*game->cellsize+1,pnt.y()*game->cellsize+1,game->cellsize - 2, game->cellsize - 2);
painter.end();
}
void towers::clearcell(QPoint pnt)
{
QPainter painter(game->background);
QPen pen(QColor::fromRgb(qRgb(150,150,150)));
QBrush brush(QColor(150,150,150),Qt::SolidPattern);
painter.setPen(pen);
painter.setBrush(brush);
painter.drawRect(pnt.x()*game->cellsize+1,pnt.y()*game->cellsize+1,game->cellsize - 2, game->cellsize - 2);
painter.end();
}
/*
void towers::AddTower(QPoint point, int type) void towers::AddTower(QPoint point, int type)
{ {
} }
*/

View File

@@ -9,7 +9,11 @@ public:
towers(games *parent); towers(games *parent);
//QVector<Tower> srcTowers; //QVector<Tower> srcTowers;
//QVector<Tower> curTowers; //QVector<Tower> curTowers;
void AddTower(QPoint point, int type); //void AddTower(QPoint point, int type);
void drawcell(QPoint pnt);
void clearcell(QPoint pnt);
private:
games * game;
}; };
#endif // TOWERS_H #endif // TOWERS_H

View File

@@ -1,26 +1,22 @@
#include <QUdpSocket> #include <QUdpSocket>
#include <QObject> #include <QObject>
//#include <iostream>
//using std::cout;
//using std::endl;
class UdpSender : public QObject class UdpSender : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
QString recstr; QString recstr;
UdpSender(QString IP, quint16 Port); UdpSender(QString IP, quint16 Port);
~UdpSender(); ~UdpSender();
void connectSend(QString s); void connectSend(QString s);
public slots: public slots:
void slotRead(); void slotRead();
private: private:
QUdpSocket * sock; QUdpSocket * sock;
QHostAddress addr; QHostAddress addr;
quint16 port; quint16 port;
quint32 sz; quint32 sz;
QByteArray * senddata; QByteArray * senddata;
signals: signals:
void dataResieved(QByteArray * data); void dataResieved(QByteArray * data);
}; };