Commit fe5d3e85 authored by zhixuan wang's avatar zhixuan wang
Browse files

第一版(无磁吸,无计时器,无判断,有闪退)

parent 90c6bcc5
-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
CMakeFiles/main.dir/src/main.c.obj CMakeFiles/main.dir/include/draw.c.obj CMakeFiles/main.dir/include/exception.c.obj CMakeFiles/main.dir/include/game.c.obj CMakeFiles/main.dir/include/genlib.c.obj CMakeFiles/main.dir/include/graphics.c.obj CMakeFiles/main.dir/include/homepage.c.obj CMakeFiles/main.dir/include/imgui.c.obj CMakeFiles/main.dir/include/linkedlist.c.obj CMakeFiles/main.dir/include/random.c.obj CMakeFiles/main.dir/include/simpio.c.obj CMakeFiles/main.dir/include/strlib.c.obj
CMAKE_PROGRESS_1 = 1
CMAKE_PROGRESS_2 = 2
CMAKE_PROGRESS_3 = 3
CMAKE_PROGRESS_4 = 4
CMAKE_PROGRESS_5 = 5
CMAKE_PROGRESS_6 = 6
CMAKE_PROGRESS_7 = 7
CMAKE_PROGRESS_8 = 8
CMAKE_PROGRESS_9 = 9
CMAKE_PROGRESS_10 = 10
CMAKE_PROGRESS_11 = 11
CMAKE_PROGRESS_12 = 12
CMAKE_PROGRESS_13 = 13
CMakeFiles/main.dir/src/homepage.c.obj: E:\c\LibGraphics\src\homepage.c
CMakeFiles/main.dir/src/main.c.obj: E:\c\LibGraphics\src\main.c \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/stdio.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/crtdefs.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/_mingw.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/_mingw_mac.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/_mingw_secapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/vadefs.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/sdks/_mingw_directx.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/_mingw_print_push.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/_mingw_off_t.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/swprintf.inl \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/_mingw_print_pop.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/stdlib.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include-fixed/limits.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include-fixed/syslimits.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/limits.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/malloc.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/math.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/stddef.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/stddef.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/windows.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/sdkddkver.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/excpt.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/stdarg.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/stdarg.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/_mingw_stdarg.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/windef.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/minwindef.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/winapifamily.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/specstrings.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/sal.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/winnt.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/_mingw_unicode.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/ctype.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/apiset.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/basetsd.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/guiddef.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/string.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/sec_api/string_s.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/x86intrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/ia32intrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/mmintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/xmmintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/mm_malloc.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/emmintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/pmmintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/tmmintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/ammintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/smmintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/popcntintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/wmmintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/immintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/avxintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/avx2intrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/avx512fintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/avx512erintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/avx512pfintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/avx512cdintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/shaintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/lzcntintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/bmiintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/bmi2intrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/fmaintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/f16cintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/rtmintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/xtestintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/mm3dnow.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/prfchwintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/fma4intrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/xopintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/lwpintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/tbmintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/rdseedintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/fxsrintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/xsaveintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/xsaveoptintrin.h \
E:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/adxintrin.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/pshpack4.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/poppack.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/pshpack4.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/pshpack2.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/poppack.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/pshpack2.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/pshpack8.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/pshpack8.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/ktmtypes.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/winbase.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/apisetcconv.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/minwinbase.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/bemapiset.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/debugapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/errhandlingapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/fibersapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/fileapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/handleapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/heapapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/ioapiset.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/interlockedapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/jobapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/libloaderapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/memoryapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/namedpipeapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/namespaceapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/processenv.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/processthreadsapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/processtopologyapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/profileapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/realtimeapiset.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/securityappcontainer.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/securitybaseapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/synchapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/sysinfoapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/systemtopologyapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/threadpoolapiset.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/utilapiset.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/wow64apiset.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/winerror.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/fltwinerror.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/timezoneapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/wingdi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/pshpack1.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/winuser.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/tvout.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/winnls.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/datetimeapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/stringapiset.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/wincon.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/winver.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/winreg.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/reason.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/winnetwk.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/wnnc.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/virtdisk.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/cderr.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/dde.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/ddeml.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/dlgs.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/lzexpand.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/mmsystem.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/nb30.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/rpc.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/rpcdce.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/rpcdcep.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/rpcnsi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/rpcnterr.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/rpcasync.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/shellapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/winperf.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/winsock.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/_timeval.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/_bsd_types.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/inaddr.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/psdk_inc/_xmitfile.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/wincrypt.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/bcrypt.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/ncrypt.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/winefs.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/winscard.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/wtypes.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/rpcndr.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/rpcnsip.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/rpcsal.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/ole2.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/objbase.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/combaseapi.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/wtypesbase.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/unknwnbase.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/objidlbase.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/cguid.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/objidl.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/unknwn.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/urlmon.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/oleidl.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/servprov.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/msxml.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/oaidl.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/propidl.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/oleauto.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/winioctl.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/winsmcrd.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/winspool.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/prsht.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/commdlg.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/stralign.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/sec_api/stralign_s.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/winsvc.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/mcx.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/imm.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/olectl.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/ocidl.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/conio.h \
E:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/sec_api/conio_s.h \
E:/c/LibGraphics/include/graphics.h E:/c/LibGraphics/include/extgraph.h \
E:/c/LibGraphics/include/genlib.h E:/c/LibGraphics/include/graphics.h \
E:/c/LibGraphics/include/genlib.h E:/c/LibGraphics/include/simpio.h \
E:/c/LibGraphics/include/strlib.h E:/c/LibGraphics/include/linkedlist.h \
E:/c/LibGraphics/include/imgui.h E:/c/LibGraphics/include/homepage.h \
E:/c/LibGraphics/include/game.h E:/c/LibGraphics/include/draw.h
# CMAKE generated file: DO NOT EDIT!
# Generated by "MinGW Makefiles" Generator, CMake Version 3.26
# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target
# Allow only one "make -f Makefile2" at a time, but pass parallelism.
.NOTPARALLEL:
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Disable VCS-based implicit rules.
% : %,v
# Disable VCS-based implicit rules.
% : RCS/%
# Disable VCS-based implicit rules.
% : RCS/%,v
# Disable VCS-based implicit rules.
% : SCCS/s.%
# Disable VCS-based implicit rules.
% : s.%
.SUFFIXES: .hpux_make_needs_suffix_list
# Command-line flag to silence nested $(MAKE).
$(VERBOSE)MAKESILENT = -s
#Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
SHELL = cmd.exe
# The CMake executable.
CMAKE_COMMAND = E:\bin\cmake.exe
# The command to remove a file.
RM = E:\bin\cmake.exe -E rm -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = E:\c\LibGraphics
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = E:\c\LibGraphics\build
#=============================================================================
# Targets provided globally by CMake.
# Special rule for the target edit_cache
edit_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
E:\bin\cmake-gui.exe -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : edit_cache
# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast
# Special rule for the target rebuild_cache
rebuild_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
E:\bin\cmake.exe --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache
# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast
# The main all target
all: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start E:\c\LibGraphics\build\CMakeFiles E:\c\LibGraphics\build\\CMakeFiles\progress.marks
$(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 all
$(CMAKE_COMMAND) -E cmake_progress_start E:\c\LibGraphics\build\CMakeFiles 0
.PHONY : all
# The main clean target
clean:
$(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 clean
.PHONY : clean
# The main clean target
clean/fast: clean
.PHONY : clean/fast
# Prepare targets for installation.
preinstall: all
$(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 preinstall
.PHONY : preinstall
# Prepare targets for installation.
preinstall/fast:
$(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 preinstall
.PHONY : preinstall/fast
# clear depends
depend:
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles\Makefile.cmake 1
.PHONY : depend
#=============================================================================
# Target rules for targets named main
# Build rule for target.
main: cmake_check_build_system
$(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 main
.PHONY : main
# fast build rule for target.
main/fast:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/build
.PHONY : main/fast
include/draw.obj: include/draw.c.obj
.PHONY : include/draw.obj
# target to build an object file
include/draw.c.obj:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/draw.c.obj
.PHONY : include/draw.c.obj
include/draw.i: include/draw.c.i
.PHONY : include/draw.i
# target to preprocess a source file
include/draw.c.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/draw.c.i
.PHONY : include/draw.c.i
include/draw.s: include/draw.c.s
.PHONY : include/draw.s
# target to generate assembly for a file
include/draw.c.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/draw.c.s
.PHONY : include/draw.c.s
include/exception.obj: include/exception.c.obj
.PHONY : include/exception.obj
# target to build an object file
include/exception.c.obj:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/exception.c.obj
.PHONY : include/exception.c.obj
include/exception.i: include/exception.c.i
.PHONY : include/exception.i
# target to preprocess a source file
include/exception.c.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/exception.c.i
.PHONY : include/exception.c.i
include/exception.s: include/exception.c.s
.PHONY : include/exception.s
# target to generate assembly for a file
include/exception.c.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/exception.c.s
.PHONY : include/exception.c.s
include/game.obj: include/game.c.obj
.PHONY : include/game.obj
# target to build an object file
include/game.c.obj:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/game.c.obj
.PHONY : include/game.c.obj
include/game.i: include/game.c.i
.PHONY : include/game.i
# target to preprocess a source file
include/game.c.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/game.c.i
.PHONY : include/game.c.i
include/game.s: include/game.c.s
.PHONY : include/game.s
# target to generate assembly for a file
include/game.c.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/game.c.s
.PHONY : include/game.c.s
include/genlib.obj: include/genlib.c.obj
.PHONY : include/genlib.obj
# target to build an object file
include/genlib.c.obj:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/genlib.c.obj
.PHONY : include/genlib.c.obj
include/genlib.i: include/genlib.c.i
.PHONY : include/genlib.i
# target to preprocess a source file
include/genlib.c.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/genlib.c.i
.PHONY : include/genlib.c.i
include/genlib.s: include/genlib.c.s
.PHONY : include/genlib.s
# target to generate assembly for a file
include/genlib.c.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/genlib.c.s
.PHONY : include/genlib.c.s
include/graphics.obj: include/graphics.c.obj
.PHONY : include/graphics.obj
# target to build an object file
include/graphics.c.obj:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/graphics.c.obj
.PHONY : include/graphics.c.obj
include/graphics.i: include/graphics.c.i
.PHONY : include/graphics.i
# target to preprocess a source file
include/graphics.c.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/graphics.c.i
.PHONY : include/graphics.c.i
include/graphics.s: include/graphics.c.s
.PHONY : include/graphics.s
# target to generate assembly for a file
include/graphics.c.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/graphics.c.s
.PHONY : include/graphics.c.s
include/homepage.obj: include/homepage.c.obj
.PHONY : include/homepage.obj
# target to build an object file
include/homepage.c.obj:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/homepage.c.obj
.PHONY : include/homepage.c.obj
include/homepage.i: include/homepage.c.i
.PHONY : include/homepage.i
# target to preprocess a source file
include/homepage.c.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/homepage.c.i
.PHONY : include/homepage.c.i
include/homepage.s: include/homepage.c.s
.PHONY : include/homepage.s
# target to generate assembly for a file
include/homepage.c.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/homepage.c.s
.PHONY : include/homepage.c.s
include/imgui.obj: include/imgui.c.obj
.PHONY : include/imgui.obj
# target to build an object file
include/imgui.c.obj:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/imgui.c.obj
.PHONY : include/imgui.c.obj
include/imgui.i: include/imgui.c.i
.PHONY : include/imgui.i
# target to preprocess a source file
include/imgui.c.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/imgui.c.i
.PHONY : include/imgui.c.i
include/imgui.s: include/imgui.c.s
.PHONY : include/imgui.s
# target to generate assembly for a file
include/imgui.c.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/imgui.c.s
.PHONY : include/imgui.c.s
include/linkedlist.obj: include/linkedlist.c.obj
.PHONY : include/linkedlist.obj
# target to build an object file
include/linkedlist.c.obj:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/linkedlist.c.obj
.PHONY : include/linkedlist.c.obj
include/linkedlist.i: include/linkedlist.c.i
.PHONY : include/linkedlist.i
# target to preprocess a source file
include/linkedlist.c.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/linkedlist.c.i
.PHONY : include/linkedlist.c.i
include/linkedlist.s: include/linkedlist.c.s
.PHONY : include/linkedlist.s
# target to generate assembly for a file
include/linkedlist.c.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/linkedlist.c.s
.PHONY : include/linkedlist.c.s
include/random.obj: include/random.c.obj
.PHONY : include/random.obj
# target to build an object file
include/random.c.obj:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/random.c.obj
.PHONY : include/random.c.obj
include/random.i: include/random.c.i
.PHONY : include/random.i
# target to preprocess a source file
include/random.c.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/random.c.i
.PHONY : include/random.c.i
include/random.s: include/random.c.s
.PHONY : include/random.s
# target to generate assembly for a file
include/random.c.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/random.c.s
.PHONY : include/random.c.s
include/simpio.obj: include/simpio.c.obj
.PHONY : include/simpio.obj
# target to build an object file
include/simpio.c.obj:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/simpio.c.obj
.PHONY : include/simpio.c.obj
include/simpio.i: include/simpio.c.i
.PHONY : include/simpio.i
# target to preprocess a source file
include/simpio.c.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/simpio.c.i
.PHONY : include/simpio.c.i
include/simpio.s: include/simpio.c.s
.PHONY : include/simpio.s
# target to generate assembly for a file
include/simpio.c.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/simpio.c.s
.PHONY : include/simpio.c.s
include/strlib.obj: include/strlib.c.obj
.PHONY : include/strlib.obj
# target to build an object file
include/strlib.c.obj:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/strlib.c.obj
.PHONY : include/strlib.c.obj
include/strlib.i: include/strlib.c.i
.PHONY : include/strlib.i
# target to preprocess a source file
include/strlib.c.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/strlib.c.i
.PHONY : include/strlib.c.i
include/strlib.s: include/strlib.c.s
.PHONY : include/strlib.s
# target to generate assembly for a file
include/strlib.c.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/include/strlib.c.s
.PHONY : include/strlib.c.s
src/main.obj: src/main.c.obj
.PHONY : src/main.obj
# target to build an object file
src/main.c.obj:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/src/main.c.obj
.PHONY : src/main.c.obj
src/main.i: src/main.c.i
.PHONY : src/main.i
# target to preprocess a source file
src/main.c.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/src/main.c.i
.PHONY : src/main.c.i
src/main.s: src/main.c.s
.PHONY : src/main.s
# target to generate assembly for a file
src/main.c.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles\main.dir\build.make CMakeFiles/main.dir/src/main.c.s
.PHONY : src/main.c.s
# Help Target
help:
@echo The following are some of the valid targets for this Makefile:
@echo ... all (the default if no target is provided)
@echo ... clean
@echo ... depend
@echo ... edit_cache
@echo ... rebuild_cache
@echo ... main
@echo ... include/draw.obj
@echo ... include/draw.i
@echo ... include/draw.s
@echo ... include/exception.obj
@echo ... include/exception.i
@echo ... include/exception.s
@echo ... include/game.obj
@echo ... include/game.i
@echo ... include/game.s
@echo ... include/genlib.obj
@echo ... include/genlib.i
@echo ... include/genlib.s
@echo ... include/graphics.obj
@echo ... include/graphics.i
@echo ... include/graphics.s
@echo ... include/homepage.obj
@echo ... include/homepage.i
@echo ... include/homepage.s
@echo ... include/imgui.obj
@echo ... include/imgui.i
@echo ... include/imgui.s
@echo ... include/linkedlist.obj
@echo ... include/linkedlist.i
@echo ... include/linkedlist.s
@echo ... include/random.obj
@echo ... include/random.i
@echo ... include/random.s
@echo ... include/simpio.obj
@echo ... include/simpio.i
@echo ... include/simpio.s
@echo ... include/strlib.obj
@echo ... include/strlib.i
@echo ... include/strlib.s
@echo ... src/main.obj
@echo ... src/main.i
@echo ... src/main.s
.PHONY : help
#=============================================================================
# Special targets to cleanup operation of make.
# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles\Makefile.cmake 0
.PHONY : cmake_check_build_system
# Install script for directory: E:/c/LibGraphics
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/main")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set default install directory permissions.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "E:/Dev-Cpp/MinGW64/bin/objdump.exe")
endif()
if(CMAKE_INSTALL_COMPONENT)
set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
else()
set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
file(WRITE "E:/c/LibGraphics/build/${CMAKE_INSTALL_MANIFEST}"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
6.000000 0.000000 2.700000 1.500000
3.000000 180.000000 3.673043 1.888696
0.000000 0.000000 2.264348 5.144348
2.000000 0.000000 1.909565 4.820870
4.000000 0.000000 6.281739 3.255652
1.000000 225.000000 7.012174 4.090435
5.000000 180.000000 1.867826 2.222609
File added
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stddef.h>
#include <windows.h>
#include <olectl.h>
#include <mmsystem.h>
#include <wingdi.h>
#include <ole2.h>
#include <ocidl.h>
#include <winuser.h>
#include <conio.h>
#include "graphics.h"
#include "extgraph.h"
#include "genlib.h"
#include "simpio.h"
#include "strlib.h"
#include "linkedlist.h"
#include "imgui.h"
#include "game.h"
#include "homepage.h"
#include "game.h"
#include "draw.h"
double turn(double angle, double current_angle)
{
current_angle += angle;
while (current_angle > 360.0)
{
current_angle -= 360.0;
}
return current_angle;
}
void move(double distance, double current_angle)
{
double x = GetCurrentX();
double y = GetCurrentY();
MovePen(x + distance * cos(current_angle * 3.14 / 180), y + distance * sin(current_angle * 3.14 / 180));
}
void forward(double distance, double current_angle)
{
DrawLine(distance * cos(current_angle * 3.14 / 180), distance * sin(current_angle * 3.14 / 180));
}
void draw_piece(void)
{
double a = GetFontHeight() * 20;
double width = GetWindowWidth();
double height = GetWindowHeight();
double x, y, angle, now_num;
FILE *fp;
if ((fp = fopen("game", "r")) == NULL)
{
printf("error");
exit(0);
}
while (feof(fp) == 0)
{
fscanf(fp, "%lf %lf %lf %lf\n", &now_num, &angle, &x, &y);
// printf("%lf\n", now_num);
SetPenColor("blue");
switch ((int)now_num + 1)
{
case 1:
case 2:
{
MovePen(x, y);
StartFilledRegion(1);
forward(a / sqrt(2), angle);
angle = turn(-135 + 360, angle);
forward(a, angle);
angle = turn(-135 + 360, angle);
forward(a / sqrt(2), angle);
angle = turn(-90 + 360, angle);
EndFilledRegion();
break;
}
case 3:
{
MovePen(x, y);
StartFilledRegion(1);
forward(a / 2, angle);
angle = turn(360 - 135, angle);
forward(a / sqrt(2), angle);
angle = turn(360 - 135, angle);
forward(a / 2, angle);
angle = turn(-90 + 360, angle);
EndFilledRegion();
break;
}
case 4:
{
MovePen(x, y);
StartFilledRegion(1);
forward(a / sqrt(2) / 2, angle);
angle = turn(270, angle);
forward(a / sqrt(2) / 2, angle);
angle = turn(270, angle);
forward(a / sqrt(2) / 2, angle);
angle = turn(270, angle);
forward(a / sqrt(2) / 2, angle);
angle = turn(270, angle);
EndFilledRegion();
break;
}
case 5:
{
MovePen(x, y);
StartFilledRegion(1);
forward(a / 2, angle);
angle = turn(360 - 135, angle);
forward(a / 2 / sqrt(2), angle);
angle = turn(360 - 45, angle);
forward(a / 2, angle);
angle = turn(360 - 135, angle);
forward(a / 2 / sqrt(2), angle);
angle = turn(-45 + 360, angle);
EndFilledRegion();
break;
}
case 6:
case 7:
{
MovePen(x, y);
StartFilledRegion(1);
forward(a / 2 / sqrt(2), angle);
angle = turn(360 - 135, angle);
forward(a / 2, angle);
angle = turn(360 - 135, angle);
forward(a / 2 / sqrt(2), angle);
angle = turn(-90 + 360, angle);
EndFilledRegion();
break;
}
}
MovePen(x, y);
// forward(GetFontHeight() / 4, angle);
SetPenColor("red");
StartFilledRegion(1);
DrawArc(GetFontHeight() / 4, 0, 360);
EndFilledRegion();
}
fclose(fp);
}
void draw_figure(num)
{
double a = GetFontHeight() * 20;
double width = GetWindowWidth();
double height = GetWindowHeight();
double x = width / 10 * 6;
double y = height / 10 * 4;
switch (num)
{
case 1:
{
MovePen(x, y);
draw_figure_first(a, x, y);
break;
}
case 2:
{
break;
}
case 3:
{
break;
}
case 4:
{
break;
}
case 5:
{
break;
}
}
}
\ No newline at end of file
#ifndef _draw_h
#define _draw_h
/**
*
*/
double turn(double angle, double current_angle);
void move(double distance, double current_angle);
void forward(double distance, double current_angle);
void draw_piece(void);
void draw_figure(int num);
#endif
\ No newline at end of file
/*
* File: exception.c
* Version: 1.0
* Last modified on Sun Jul 24 10:28:11 1994 by eroberts
* -----------------------------------------------------
* This file implements the C exception handler. Much of the
* real work is done in the exception.h header file.
*/
#include <stdio.h>
#include <stdarg.h>
#include "genlib.h"
#include "gcalloc.h"
#include "exception.h"
/*
* Constant: MaxUnhandledMessage
* -----------------------------
* This constant should be large enough to accommodate the
* unhandled exception message, including the exception name.
*/
#define MaxUnhandledMessage 100
/* Publically accessible exceptions */
exception ANY = { "ANY" };
exception ErrorException = { "ErrorException" };
/*
* Global variable: exceptionStack
* -------------------------------
* This variable is the head pointer to a linked list of
* context blocks that act as the exception stack. The chain
* pointer is referenced by the macros in exception.h and must
* therefore be exported, but clients should not reference it
* directly.
*/
context_block *exceptionStack = NULL;
/* Private function prototypes */
static context_block *FindHandler(exception *e);
/* Public entries */
/*
* Function: RaiseException
* ------------------------
* This function operates by finding an appropriate handler
* and then using longjmp to return to the context stored
* there after resetting the exception stack. If no handler
* exists, the function notes an unhandled exception. Much
* of the complexity comes from the fact that allocation
* within the exception handler may fail.
*/
void RaiseException(exception *e, string name, void *value)
{
context_block *cb;
char errbuf[MaxUnhandledMessage + 1];
string errmsg;
int errlen;
cb = FindHandler(e);
if (cb == NULL) {
sprintf(errbuf, "Unhandled exception (%.30s)", name);
errlen = strlen(errbuf);
if (_acb == NULL) {
errmsg = malloc(errlen + 1);
} else {
errmsg = _acb->allocMethod(errlen + 1);
}
if (errmsg == NULL) {
errmsg = "Unhandled exception: unknown";
} else {
strcpy(errmsg, errbuf);
}
Error(errmsg);
}
exceptionStack = cb;
cb->id = e;
cb->value = value;
cb->name = name;
longjmp(cb->jmp, ES_Exception);
}
/*
* Function: HandlerExists
* -----------------------
* This public entry is used primarily by the Error function
* to determine if ErrorException has been trapped, although
* it is available to other clients as well.
*/
bool HandlerExists(exception *e)
{
return (FindHandler(e) != NULL);
}
/* Private functions */
/*
* Function: FindHandler
* ---------------------
* This function searches the exception stack to find the
* first active handler for the indicated exception. If a
* match is found, the context block pointer is returned.
* If not, FindHandler returns NULL.
*/
static context_block *FindHandler(exception *e)
{
context_block *cb;
exception *t;
int i;
for (cb = exceptionStack; cb != NULL; cb = cb->link) {
for (i = 0; i < cb->nx; i++) {
t = cb->array[i];
if (t == e || t == &ANY) return (cb);
}
}
return (NULL);
}
/*
* File: exception.h
* Version: 1.0
* Last modified on Sun Jul 24 10:26:20 1994 by eroberts
* -----------------------------------------------------
* The exception package provides a general exception
* handling mechanism for use with C that is portable
* across a variety of compilers and operating systems.
*/
#ifndef _exception_h
#define _exception_h
/*
* Overview:
* --------
* The exception package makes it possible for clients to
* specify a handler for an exceptional conditions in a
* syntactically readable way. As a client, your first step
* is to declare an exception condition name by declaring
* a variable of type exception, as in
*
* exception MyException;
*
* Normal visibility rules apply, so that you should declare
* the exception variable at the appropriate level. For
* example, if an exception is local to an implementation,
* it should be declared statically within that module. If
* an exception condition is shared by many modules, the
* exception variable should be declared in an interface
* and exported to all clients that need it. This package
* defines and exports the exception ErrorException, which
* is likely to be sufficient for many clients.
*
* The basic functionality of exceptions is that one piece
* of code can "raise" an exception so that it can then be
* "handled" by special code in a dynamically enclosing
* section of the program. Exceptions are raised by calling
* the pseudo-function raise with the exception name, as in
*
* raise(MyException);
*
* Exceptions are handled using the "try" statement
* (actually implemented using macros), which has the form:
*
* try {
* . . . statements in the body of the block . . .
* except(exception1)
* . . . statements to handle exception 1 . . .
* except(exception2)
* . . . statements to handle exception 2 . . .
* except(ANY)
* . . . statements to handle any exception . . .
* } endtry
*
* Any number of except clauses may appear (up to a
* maximum defined by the constant MaxExceptionsPerScope),
* and the ANY clause is optional.
*
* When the program encounters the "try" statement, the
* statements in the body are executed. If no exception
* conditions are raised during that execution, either
* in this block or by a function call nested inside
* this block, control passes to the end of the "try"
* statement when the last statement in the block is
* executed. If an exception is raised during the
* dynamic execution of the block, control immediately
* passes to the statements in the appropriate except
* clause. Only the statements in that clause are
* executed; no break statement is required to exit
* the block. If no handler for the raised exception
* appears anywhere in the control history, the program
* exits with an error.
*
* Examples of use:
*
* 1. Catching errors.
*
* The following code fragment traps calls to Error, so
* that the program does not quit but instead returns
* to the top-level read-and-execute loop.
*
* while (TRUE) {
* try {
* printf("> ");
* cmd = ReadCommand();
* ExecuteCommand(cmd);
* except(ErrorException)
* -- additional handling code, if any --
* } endtry
* }
*
* If either ReadCommand or ExecuteCommand calls Error,
* control will be passed back to the main loop, after
* executing any additional handler code. (The error
* message is printed by the Error routine, so it is
* often the case that no additional work is needed.)
*
* 2. Handling control-C
*
* The following code extends the example above so that
* typing ^C also returns to top-level.
*
* #include <signal.h>
*
* static exception ControlCException;
* static int errorCount = 0;
* static int ControlCHandler();
*
* main()
* {
* string cmd;
*
* signal(SIGINT, ControlCHandler);
* while (TRUE) {
* try {
* printf("> ");
* cmd = ReadCommand();
* ExecuteCommand(cmd);
* except(ControlCException);
* printf("^C\n");
* signal(SIGINT, ControlCHandler);
* except(ErrorException)
* errorCount++;
* } endtry
* }
* }
*
* static int ControlCHandler()
* {
* raise(ControlCException);
* }
*/
/*
* Actual interface specification
* ------------------------------
* Most of the implementation of the exception mechanism is
* actually done in the macros defined by this file.
* Clients should ordinarily be able to read the description
* above and ignore the detailed code below.
*/
#include <setjmp.h>
#include <string.h>
#include "genlib.h"
/* Define parameters and error status indicators */
#define MaxExceptionsPerScope 10
#define ETooManyExceptClauses 101
#define EUnhandledException 102
/* Codes to keep track of the state of the try handler */
#define ES_Initialize 0
#define ES_EvalBody 1
#define ES_Exception 2
/*
* Type: exception
* ---------------
* Exceptions are specified by their address, so that the
* actual structure does not matter. Strings are used here
* so that exporters of exceptions can store the exception
* name for the use of debuggers and other tools.
*/
typedef struct { string name; } exception;
/*
* Type: context_block
* -------------------
* This structure is used internally to maintain a chain of
* exception scopes on the control stack.
*/
typedef struct ctx_block {
jmp_buf jmp;
int nx;
exception *array[MaxExceptionsPerScope];
exception *id;
void *value;
string name;
struct ctx_block *link;
} context_block;
/* Declare the built-in exceptions */
extern exception ErrorException;
extern exception ANY;
/* Declare a global pointer to the context stack */
extern context_block *exceptionStack;
/*
* Function: RaiseException
* Usage: RaiseException(&e, name, value);
* ---------------------------------------
* This function is called by the raise macro and does the
* work necessary to raise the exception. See the exception.c file
* for details. Clients do not ordinarily call this directly.
*/
void RaiseException(exception *e, string name, void *value);
/*
* Function: HandlerExists
* Usage: if (HandlerExists(&e)) ...
* ---------------------------------
* Determines whether a handler exists for an exception in
* the dynamically enclosing scope. Intended only for use
* by special clients, such as the Error package.
*/
bool HandlerExists(exception *e);
/* Define the pseudo-functions for raise and try */
#define raise(e) RaiseException(&e, #e, NULL)
#define try \
{ \
jmp_buf _tmpbuf; \
context_block _ctx; \
volatile int _es; \
_es = ES_Initialize; \
_ctx.nx = 0; \
_ctx.link = exceptionStack; \
exceptionStack = (context_block *) &_ctx; \
if (setjmp(_tmpbuf) != 0) _es = ES_Exception; \
memcpy((void *) _ctx.jmp, (void *) _tmpbuf, sizeof(jmp_buf)); \
while (1) { \
if (_es == ES_EvalBody)
#define except(e) \
if (_es == ES_EvalBody) exceptionStack = _ctx.link; \
break; \
} \
if (_es == ES_Initialize) { \
if (_ctx.nx >= MaxExceptionsPerScope) \
exit(ETooManyExceptClauses); \
_ctx.array[_ctx.nx++] = &e; \
} else if (_ctx.id == &e || &e == &ANY) { \
exceptionStack = _ctx.link;
#define endtry \
if (_es != ES_Initialize) break; \
_es = ES_EvalBody; \
} \
}
#define GetExceptionName() _ctx.name
#define GetExceptionValue() _ctx.value
#define GetCurrentException() _ctx.id
#endif
/*
* File: extgraph.h
* Version: 3.0
* Last modified on Tue Oct 4 11:24:41 1994 by eroberts
* -----------------------------------------------------
* This interface is the extended graphics interface.
* It includes all of the facilities in graphics.h, plus
* several additional functions that are designed to
* support more sophisticated, interactive graphics.
*/
#ifndef _extgraph_h
#define _extgraph_h
#include "genlib.h"
/* Exported functions */
/* Section 1 -- Basic functions from graphics.h */
#include "graphics.h"
/* Section 2 -- Elliptical arcs */
/*
* Function: DrawEllipticalArc
* Usage: DrawEllipticalArc(rx, ry, start, sweep);
* -----------------------------------------------
* This procedure draws an elliptical arc. It is exactly
* the same in its operation as DrawArc in the graphics.h
* interface, except that the radius is different along the
* two axes.
*/
void DrawEllipticalArc(double rx, double ry,
double start, double sweep);
/* Section 3 -- Graphical regions*/
/*
* Functions: StartFilledRegion, EndFilledRegion
* Usage: StartFilledRegion(density);
* . . . other calls . . .
* EndFilledRegion();
* ------------------------------
* These calls make it possible to draw filled shapes on the
* display. After calling StartFilledRegion, any calls to
* DrawLine and DrawArc are used to create a shape definition
* and do not appear on the screen until EndFilledRegion is
* called. The lines and arcs must be consecutive, in the
* sense that each new element must start where the last
* one ended. MovePen calls may occur at the beginning
* or the end of the region, but not in the interior. When
* EndFilledRegion is called, the entire region appears on the
* screen, with its interior filled in. The density parameter
* is a number between 0 and 1 and indicates how the dot density
* to be used for the fill pattern. If density is 1, the shape
* will be filled in a solid color; if it is 0, the fill will be
* invisible. In between, the implementation will use a dot
* pattern that colors some of the screen dots but not others.
*/
void StartFilledRegion(double density);
void EndFilledRegion(void);
/* Section 4 -- String functions */
/*
* Function: DrawTextString
* Usage: DrawTextString(text);
* ----------------------------
* This function displays the string text at the current point
* in the current font and size. The current point is updated
* so that the next DrawTextString command would continue from
* the next character position. The string may not include the
* newline character.
*/
void DrawTextString(string text);
/*
* Function: TextStringWidth
* Usage: w = TextStringWidth(text);
* ---------------------------------
* This function returns the width of the text string if displayed
* at the current font and size.
*/
double TextStringWidth(string text);
/*
* Function: SetFont
* Usage: SetFont(font);
* ---------------------
* This function sets a new font according to the font string,
* which is case-independent. Different systems support different
* fonts, although common ones like "Times" and "Courier" are often
* supported. Initially, the font is set to "Default" which is
* always supported, although the underlying font is system
* dependent. If the font name is unrecognized, no error is
* generated, and the font remains unchanged. If you need to
* detect this condition, you can call GetFont to see if the
* change took effect. By not generating an error in this case,
* programs become more portable.
*/
void SetFont(string font);
/*
* Function: GetFont
* Usage: font = GetFont();
* ------------------------
* This function returns the current font name as a string.
*/
string GetFont(void);
/*
* Function: SetPointSize
* Usage: SetPointSize(size);
* --------------------------
* This function sets a new point size. If the point size is
* not supported for a particular font, the closest existing
* size is selected.
*/
void SetPointSize(int size);
/*
* Function: GetPointSize
* Usage: size = GetPointSize();
* -----------------------------
* This function returns the current point size.
*/
int GetPointSize(void);
/*
* Text style constants
* --------------------
* The constants Bold and Italic are used in the SetStyle
* command to specify the desired text style. They may also
* be used in combination by adding these constants together,
* as in Bold + Italic. The constant Normal indicates the
* default style.
*/
#define Normal 0
#define Bold 1
#define Italic 2
/*
* Function: SetStyle
* Usage: SetStyle(style);
* -----------------------
* This function establishes the current style properties
* for text based on the parameter style, which is an integer
* representing the sum of any of the text style constants.
*/
void SetStyle(int style);
/*
* Function: GetStyle
* Usage: style = GetStyle();
* --------------------------
* This function returns the current style.
*/
int GetStyle(void);
/*
* Functions: GetFontAscent, GetFontDescent, GetFontHeight
* Usage: ascent = GetFontAscent();
* descent = GetFontDescent();
* height = GetFontHeight();
* -------------------------------------------------------
* These functions return properties of the current font that are
* used to calculate how to position text vertically on the page.
* The ascent of a font is the distance from the baseline to the
* top of the largest character; the descent is the maximum
* distance any character extends below the baseline. The height
* is the total distance between two lines of text, including the
* interline space (which is called leading).
*
* Examples:
* To change the value of y so that it indicates the next text
* line, you need to execute
*
* y -= GetFontHeight();
*
* To center text vertically around the coordinate y, you need
* to start the pen at
*
* y - GetFontAscent() / 2
*/
double GetFontAscent(void);
double GetFontDescent(void);
double GetFontHeight(void);
/* Section 5 -- Mouse support */
/*
* Functions: GetMouseX, GetMouseY
* Usage: x = GetMouseX();
* y = GetMouseY();
* -------------------------------
* These functions return the x and y coordinates of the mouse,
* respectively. The coordinate values are real numbers measured
* in inches from the origin and therefore match the drawing
* coordinates.
*/
double GetMouseX(void);
double GetMouseY(void);
/*
* Functions: MouseButtonIsDown
* Usage: if (MouseButtonIsDown()) . . .
* -------------------------------------
* This function returns TRUE if the mouse button is currently
* down. For maximum compatibility among implementations, the
* mouse is assumed to have one button. If the mouse has more
* than one button, this function returns TRUE if any button
* is down.
*/
bool MouseButtonIsDown(void);
/*
* Functions: WaitForMouseDown, WaitForMouseUp
* Usage: WaitForMouseDown();
* WaitForMouseUp();
* -------------------------------------------
* The WaitForMouseDown function waits until the mouse button
* is pressed and then returns. WaitForMouseUp waits for the
* button to be released.
*/
void WaitForMouseDown(void);
void WaitForMouseUp(void);
/* Section 6 -- Color support */
/*
* Function: HasColor
* Usage: if (HasColor()) . . .
* ----------------------------
* This function returns TRUE if the graphics window can display a
* color image. Note that this condition is stronger than simply
* checking whether a color display is available. Because color
* windows require more memory than black and white ones, this
* function will return FALSE with a color screen if there is
* not enough memory to store a colored image. On the Macintosh,
* for example, it is usually necessary to increase the partition
* size to at least 1MB before color windows can be created.
*/
bool HasColor(void);
/*
* Function: SetPenColor
* Usage: SetPenColor(color);
* --------------------------
* This function sets the color of the pen used for any drawing,
* including lines, text, and filled regions. The color is a
* string, which will ordinarily be one of the following
* predefined color names:
*
* Black, Dark Gray, Gray, Light Gray, White,
* Red, Yellow, Green, Cyan, Blue, Magenta
*
* The first line corresponds to standard gray scales and the
* second to the primary and secondary colors of light. The
* built-in set is limited to these colors because they are
* likely to be the same on all hardware devices. For finer
* color control, you can use the DefineColor function to
* create new color names as well.
*/
void SetPenColor(string color);
/*
* Function: GetPenColor
* Usage: color = GetPenColor();
* -----------------------------
* This function returns the current pen color as a string.
*/
string GetPenColor(void);
/*
* Function: SetPenSize
* Usage: SetPenSize(size);
* -----------------------------------------
* This function sets the size(in pixels) of the pen used for any drawing.
*/
void SetPenSize(int size);
/*
* Function: GetPenSize
* Usage: size = GetPenSize();
* -----------------------------------------
* This function returns the size(in pixels) of the pen used for any drawing.
*/
int GetPenSize(void);
/*
* Function: DefineColor
* Usage: DefineColor(name, red, green, blue);
* -------------------------------------------
* This function allows the client to define a new color name
* by supplying intensity levels for the colors red, green,
* and blue, which are the primary colors of light. The
* color values are provided as real numbers between 0 and 1,
* indicating the intensity of that color. For example,
* the predefined color Magenta has full intensity red and
* blue but no green and is therefore defined as:
*
* DefineColor("Magenta", 1, 0, 1);
*
* DefineColor allows you to create intermediate colors on
* many displays, although the results vary significantly
* depending on the hardware. For example, the following
* usually gives a reasonable approximation of brown:
*
* DefineColor("Brown", .35, .20, .05);
*/
void DefineColor(string name,
double red, double green, double blue);
/* Section 7 -- Miscellaneous functions */
/*
* Function: SetEraseMode
* Usage: SetEraseMode(TRUE);
* SetEraseMode(FALSE);
* ---------------------------
* The SetEraseMode function sets the value of the internal
* erasing flag. Setting this flag is similar to setting the
* color to "White" in its effect but does not affect the
* current color setting. When erase mode is set to FALSE,
* normal drawing is restored, using the current color.
*/
void SetEraseMode(bool mode);
/*
* Function: GetEraseMode
* Usage: mode = GetEraseMode();
* -----------------------------
* This function returns the current state of the erase mode flag.
*/
bool GetEraseMode(void);
/*
* Function: SetWindowTitle
* Usage: SetWindowTitle(title);
* -----------------------------
* This function sets the title of the graphics window, if such
* an operation is possible on the display. If it is not possible
* for a particular implementation, the call is simply ignored.
* This function may be called prior to the InitGraphics call to
* set the initial name of the window.
*/
void SetWindowTitle(string title);
/*
* Function: GetWindowTitle
* Usage: title = GetWindowTitle();
* --------------------------------
* This function returns the title of the graphics window. If the
* implementation does not support titles, this call returns the
* empty string.
*/
string GetWindowTitle(void);
/*
* Function: UpdateDisplay
* Usage: UpdateDisplay();
* -----------------------
* This function initiates an immediate update of the graphics
* window and is necessary for animation. Ordinarily, the
* graphics window is updated only when the program waits for
* user input.
*/
void UpdateDisplay(void);
/*
* Function: Pause
* Usage: Pause(seconds);
* ----------------------
* The Pause function updates the graphics window and then
* pauses for the indicated number of seconds. This function
* is useful for animation where the motion would otherwise
* be too fast.
*/
void Pause(double seconds);
/*
* Function: ExitGraphics
* Usage: ExitGraphics();
* ----------------------
* The ExitGraphics function closes the graphics window and
* exits from the application without waiting for any additional
* user interaction.
*/
void ExitGraphics(void);
/*
* Functions: SaveGraphicsState, RestoreGraphicsState
* Usage: SaveGraphicsState();
* . . . graphical operations . . .
* RestoreGraphicsState();
* ---------------------------------------------------
* The SaveGraphicsState function saves the current graphics
* state (the current pen position, the font, the point size,
* and the erase mode flag) internally, so that they can be
* restored by the next RestoreGraphicsState call. These two
* functions must be used in pairs but may be nested to any depth.
*/
void SaveGraphicsState(void);
void RestoreGraphicsState(void);
/*
* Functions: GetFullScreenWidth, GetFullScreenHeight
* Usage: width = GetFullScreenWidth();
* height = GetFullScreenHeight();
* --------------------------------------
* These functions return the height and width of the entire
* display screen, not the graphics window. Their only
* significant use is for applications that need to adjust
* the size of the graphics window based on available screen
* space. These functions may be called before InitGraphics
* has been called.
*/
double GetFullScreenWidth(void);
double GetFullScreenHeight(void);
/*
* Functions: SetWindowSize
* Usage: SetWindowSize(width, height);
* ------------------------------------
* This function sets the window size to the indicated dimensions,
* if possible. This function should be called before the graphics
* window is created by InitGraphics. Attempts to change the size
* of an existing window are ignored by most implementations. This
* function should be used sparingly because it reduces the
* portability of applications, particularly if the client
* requests more space than is available on the screen.
*/
void SetWindowSize(double width, double height);
/*
* Functions: GetXResolution, GetYResolution
* Usage: xres = GetXResolution();
* yres = GetYResolution();
* -----------------------------------------
* These functions return the number of pixels per inch along
* each of the coordinate directions and are useful for applications
* in which it is important for short distances to be represented
* uniformly in terms of dot spacing. Even though the x and y
* resolutions are the same for most displays, clients should
* not rely on this property.
*
* Note: Lines in the graphics library are one pixel unit wide and
* have a length that is always one pixel longer than you might
* expect. For example, the function call
*
* DrawLine(2 / GetXResolution(), 0);
*
* draws a line from the current point to the point two pixels
* further right, which results in a line of three pixels.
*/
double GetXResolution(void);
double GetYResolution(void);
/*pixels to inches*/
double ScaleXInches(int x);
double ScaleYInches(int y);
#endif
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stddef.h>
#include <windows.h>
#include <olectl.h>
#include <mmsystem.h>
#include <wingdi.h>
#include <ole2.h>
#include <ocidl.h>
#include <winuser.h>
#include <conio.h>
#include "graphics.h"
#include "extgraph.h"
#include "genlib.h"
#include "simpio.h"
#include "strlib.h"
#include "linkedlist.h"
#include "imgui.h"
#include "draw.h"
#include "homepage.h"
#include "game.h"
extern int rotate_figure;
struct part
{
double number;
double angle;
double particle_x;
double particle_y;
struct part *next;
};
void loading(int num)
{
double a = GetFontHeight() * 16;
double x = GetWindowWidth();
double y = GetWindowHeight();
FILE *fp_load;
if ((fp_load = fopen("game", "w")) == NULL)
{
printf("cannot open this file6\n");
exit(0);
}
int i, j;
struct part *p, *head, *temp;
p = NULL;
head = NULL;
temp = NULL;
double str_x[7] =
{
x / 20,
x / 11 * 5,
x / 20,
x / 20 * 8,
x / 10,
x / 11 * 6,
x / 10 * 3};
double str_y[7] =
{
y / 20 * 19,
y / 20 * 12,
y / 40 * 21,
y / 20 * 7,
y / 20 * 5,
y / 20 * 7,
y / 20 * 5};
for (i = 0; i < 7; i++)
{
p = (struct part *)malloc(sizeof(struct part));
p->number = i;
if (i % 2 == 0)
{
p->angle = 0.0;
}
else
{
p->angle = 180.0;
}
p->particle_x = str_x[i];
p->particle_y = str_y[i];
if (head == NULL)
{
head = p;
temp = head;
p->next = NULL;
}
else
{
while (temp->next)
{
temp = temp->next;
}
temp->next = p;
p->next = NULL;
}
}
p = head;
i = 0;
while (p)
{
fprintf(fp_load, "%lf ", (double)p->number);
fprintf(fp_load, "%lf ", p->angle);
fprintf(fp_load, "%lf ", p->particle_x);
fprintf(fp_load, "%lf\n", p->particle_y);
// printf("%lf", (double)p->number);
// printf("%d", i++);
temp = p->next;
free(p);
p = temp;
}
fclose(fp_load);
draw_piece();
draw_figure(num);
}
void rotate()
{
if (button(GenUIID(0), GetWindowWidth() / 10 * 5, GetWindowHeight() / 10, GetWindowWidth() / 8, GetFontHeight() * 2, "rotate"))
{
// printf("yyy\n");
double now_num[7], x[7], y[7], angle[7];
FILE *fp;
if ((fp = fopen("game", "r")) == NULL)
{
printf("cannot open this file5\n");
exit(0);
}
int i;
// printf("%d\n", rotate_figure);
for (i = 0; i < 7; i++)
{
fscanf(fp, "%lf %lf %lf %lf\n", &now_num[i], &angle[i], &x[i], &y[i]);
// printf("%lf %lf %lf %lf\n", now_num[i], angle[i], x[i], y[i]);
if ((int)now_num[i] == rotate_figure)
{
// printf("www");
angle[i] += 45;
while (angle[i] > 360.0)
{
angle[i] -= 360.0;
}
}
// printf("%lf %lf %lf %lf\n\n", now_num[i], angle[i], x[i], y[i]);
}
fclose(fp);
FILE *fp_open;
if ((fp_open = fopen("game", "w")) == NULL)
{
printf("cannot open this file4\n");
exit(0);
}
for (i = 0; i < 7; i++)
{
fprintf(fp_open, "%lf %lf %lf %lf\n", now_num[i], angle[i], x[i], y[i]);
}
fclose(fp_open);
}
}
void move_piece(double x, double y, double num)
{
struct part *p, *head, *temp;
head = NULL;
FILE *fp;
if ((fp = fopen("game", "r")) == NULL)
{
printf("cannot open this file3\n");
exit(0);
}
while (feof(fp) == 0)
{
p = (struct part *)malloc(sizeof(struct part));
fscanf(fp, "%lf %lf %lf %lf\n", &p->number, &p->angle, &p->particle_x, &p->particle_y);
if (p->number == num)
{
rotate_figure = (int)num;
//printf("2 %d\n", rotate_figure);
p->particle_x = x;
p->particle_y = y;
}
if (head)
{
temp = head;
while (temp->next)
{
temp = temp->next;
}
temp->next = p;
p->next = NULL;
}
else
{
head = p;
p->next = NULL;
}
}
p = head;
if (head->number == num)
{
temp = head;
while (temp->next)
{
temp = temp->next;
}
temp->next = head;
head = head->next;
p->next = NULL;
}
else
{
while (p->next->number != num && p->next)
{
p = p->next;
}
temp = p->next;
p->next = p->next->next;
while (p->next)
{
p = p->next;
}
p->next = temp;
temp->next = NULL;
}
fclose(fp);
FILE *fp_write;
if ((fp_write = fopen("game", "w")) == NULL)
{
printf("cannot open this file2\n");
exit(0);
}
// printf("3\n");
p = head;
while (p)
{
fprintf(fp_write, "%lf %lf %lf %lf\n", p->number, p->angle, p->particle_x, p->particle_y);
// printf("%lf %lf %lf %lf\n", p->number, p->angle, p->particle_x, p->particle_y);
temp = p->next;
free(p);
p = temp;
}
fclose(fp_write);
}
int judge(double x, double y)
{
double re_num, now_num;
double current_x, current_y, current_angle;
FILE *fp;
if ((fp = fopen("game", "r")) == NULL)
{
printf("cannot open this file1\n");
exit(0);
}
while (feof(fp) == 0)
{
fscanf(fp, "%lf %lf %lf %lf\n", &now_num, &current_angle, &current_x, &current_y);
if (sqrt(pow(x - current_x, 2) + pow(y - current_y, 2)) < GetFontHeight() / 4)
{
re_num = now_num;
break;
}
else
{
re_num = -1.0;
}
}
fclose(fp);
return (int)re_num;
}
\ No newline at end of file
#ifndef _game_h
#define _game_h
void loading(int num);
void rotate();
void move_piece(double x, double y, double num);
int judge(double x, double y);
#endif
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment