Carbon HACKS (breaks other stuff)

This commit is contained in:
Wolfgang Thaller 2015-09-13 16:54:15 +02:00
parent a9337f529f
commit 54591b457a
4 changed files with 28 additions and 7 deletions

View File

@ -37,7 +37,7 @@ if(APPLE)
target_link_libraries(Raytracer2 "-framework Carbon")
else()
set(CMAKE_CXX_FLAGS "-std=c++11")
if(FALSE)
# save 200KB of code by removing unused stuff
set(CMAKE_EXE_LINKER_FLAGS "-Wl,-gc-sections")
@ -55,4 +55,14 @@ else()
add_application(FixedBenchmark CONSOLE
FILES fixedbenchmark.cc fixed.h fixed.cc)
endif()
set(CMAKE_EXE_LINKER_FLAGS "-Wl,-gc-sections -nostdlib")
add_definitions(-DRETRO_CARBON)
add_application(RaytracerCarbon
raytracer2.cc
fixed.h
fixed.cc
carb.r
)
target_link_libraries(RaytracerCarbon "-lstdc++" "-lc" retrocrt "-lc" "-lgcc" retrocrt "-lc" CarbonLib)
endif()

3
Samples/Raytracer/carb.r Normal file
View File

@ -0,0 +1,3 @@
data 'carb' (0) {
$"00"
};

View File

@ -22,17 +22,20 @@
#include <ApplicationServices/ApplicationServices.h>
#else
#ifdef RETRO_CARBON
//#define __FP__
#include <math.h>
#include <Carbon.h>
#else
#include <Quickdraw.h>
#include <MacMemory.h>
#include <Sound.h>
#include <Events.h>
#include <Fonts.h>
#include <NumberFormatting.h>
#ifdef __GNUC__
QDGlobals qd;
#endif
#endif
#include "fixed.h"
@ -286,7 +289,11 @@ int main()
}
Rect r2;
SetRect(&r2,0,y,r.right,y+1);
#if TARGET_API_MAC_CARBON
CopyBits(&line, GetPortBitMapForCopyBits(GetWindowPort(win)), &line.bounds, &r2, srcCopy, NULL);
#else
CopyBits(&line, &win->portBits, &line.bounds, &r2, srcCopy, NULL);
#endif
if(Button())
return 0;
#if TARGET_API_MAC_CARBON

View File

@ -24,9 +24,10 @@ resource 'SIZE' (-1) {
dontGetFrontClicks,
ignoreChildDiedEvents,
is32BitCompatible,
reserved,
reserved,
reserved,
isHighLevelEventAware,
onlyLocalHLEvents,
notStationeryAware,
reserved,
reserved,
reserved,